Contents    Page-10    Prev    Next    Page+10    Index   

Arduino Programming

Arduino is programmed in C on a laptop:

/*  Blink
    Turns on LED for 1 second, then off, repeat.
    LED is attached to digital pin 13.
    by Scott Fitzgerald

// setup function runs once on power up
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);

// the loop function runs forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on
  delay(1000);              // wait 1 second
  digitalWrite(13, LOW);    // turn the LED off
  delay(1000);              // wait 1 second