EasyManua.ls Logo

SunFounder 3in1 Kit - Page 86

Default Icon
351 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SunFounder 3in1 Kit
Next, upload this sketch to the Arduino development board.
int ledPin = 9;
int delayTime = 500;
void setup() {
pinMode(ledPin,OUTPUT);
}
void loop() {
digitalWrite(ledPin,HIGH);
delay(delayTime);
digitalWrite(ledPin,LOW);
delay(delayTime);
}
This sketch is very similar to the one we used to control the blinking of the on-board LED, the difference is that the
value of ledPin has been changed to 9. This is because we are trying to control the level of pin 9 this time.
82 Chapter 2. Get Started with Arduino

Related product manuals