Keyestudio KS0436 Kit Manual page 32

Table of Contents

Advertisement

1) Connect the
Upload Code:
2) Open the program in the code folder- Circuit 2 Light, or directly copy
and paste the code below on the Ardunio IDE.
3) Select UPLOAD to program the sketch on the UNO Board.
int BASE = 2 ; // the I/O pin for the first LED
int NUM = 6;
void setup()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
pinMode(i, OUTPUT);
}
}
void loop()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
digitalWrite(i, LOW);
REV4
Board to a USB port on your computer.
// the number of LEDs
// set I/O pins as output
// set I/O pins as "low" , turn off LEDs
32

Advertisement

Table of Contents
loading

Table of Contents