Fig 1
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Fig 1a
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
}
Fig 2a
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT); //set Pin 2 to be an Output
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(2, HIGH); // turn on LED in Output 2)
delay(500); //wait for half a second
digitalWrite(2, LOW); //Turn LED off in Output 2
delay(500); // wait for half a second
}
Fig 3a