Reference.Loop History

Hide minor edits - Show changes to output

October 24, 2012, at 07:27 PM by Federico -
Changed line 22 from:
serial.write('H');
to:
Serial.write('H');
Changed lines 24-25 from:
serial.write('L');
to:
Serial.write('L');
October 24, 2012, at 07:27 PM by Federico -
Changed lines 8-9 from:
int buttonPin = 3;
to:
const int buttonPin = 3;
Changed line 13 from:
beginSerial(9600);
to:
Serial.begin(9600);
Changed line 22 from:
serialWrite('H');
to:
serial.write('H');
Changed lines 24-25 from:
serialWrite('L');
to:
serial.write('L');
April 16, 2007, at 04:19 PM by Paul Badger -
Deleted lines 29-30:

[[HomePage | Reference Home]]
March 24, 2006, at 11:35 PM by Jeff Gray -
Changed lines 1-2 from:
!!loop()
to:
!loop()
March 24, 2006, at 08:42 PM by Jeff Gray -
Deleted line 7:
March 24, 2006, at 08:42 PM by Jeff Gray -
Added lines 1-32:
!!loop()

After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.

!!! Example

[@

int buttonPin = 3;

// setup initializes serial and the button pin
void setup()
{
beginSerial(9600);
pinMode(buttonPin, INPUT);
}

// loop checks the button pin each time,
// and will send serial if it is pressed
void loop()
{
if (digitalRead(buttonPin) == HIGH)
serialWrite('H');
else
serialWrite('L');

delay(1000);
}
@]


[[HomePage | Reference Home]]

Share