Thursday, September 3, 2009

Slide "Hello World"

I just taught my little nephew how to write a "Hello World" program on the TouchShield Slide in 5 minutes...
  1. Dock Slide to Arduino

  2. Plug Arduino into my Computer

  3. Press the Button on the Slide

  4. Write Code for the Slide
  5. void setup()
    {
    background(0,0,0); //this paints the whole background black
    fill(0,0,255); //the inside fill of the next shape I draw will be blue
    }

    void loop()
    {
    text("Hello World", 10, 10, 16, 16); // draw Hello World on the display
    ellipse(100, 100, 20, 20); // draw an ellipse(x, y, width, height)
    rect(200, 190, 40, 40); // draw a rect(x, y, width, height)
    }


  6. Select the Slide

  7. Press Upload

  8. Check Out the Slide

1 comment:

CamDAX said...

why do i keep getting this error
In function 'void setup()':
error: 'background' was not declared in this scope In function 'void loop()':