EasyManua.ls Logo

SunFounder 3in1 Kit - Page 92

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
Parameters
pin: the Arduino pin number.
value: HIGH or LOW.
Example of Digital Write:
const int pin = 13;
void setup() {
pinMode(pin, OUTPUT); // sets the digital pin as output
}
void loop() {
digitalWrite(pin, HIGH); // sets the digital pin on
delay(1000); // waits for a second
digitalWrite(pin, LOW); // sets the digital pin off
delay(1000); // waits for a second
}
Notes and Warnings
The pins 0~13 are all digital pins.
Do not use pins 0 and 1, as they are used to communicate with the computer. Connecting anything to these pins
88 Chapter 4. Basic Projects

Related product manuals