
24
delay(1000); // wait for a second.
digitalWrite(ledPin, LOW); // set the LED off.
delay(1000); // wait for a second
}
Code Explanation:
Single line comments start with
//
and everything up until the end
of that line is considered a comment.
Comments are a great way to leave notes in your code explaining
why you wrote it the way you did.
The first line of code is:
int ledPin = 10; // define digital pin 10
As the comment above it explains, this is giving a name to the pin that
the LED is connected to. You can change the connection pin here.
Next, we have the “setup” and “loop” function
void setup()
Every Arduino sketch must have a 'setup' function, and the place where
you might want to add instructions of your own is between the { and
the }.
In this case, there is just one command there, which, as the comment
Содержание KS0436
Страница 7: ...7...
Страница 10: ...10 Your baseplate is now assembled...
Страница 12: ...12 click the Arduino icon to open...
Страница 15: ...15...
Страница 16: ...16 The Kit contains extensive electronic components Below shows you a part of kit components...
Страница 22: ...22...
Страница 30: ...30 Check out the wiring below to see how everything is connected Schematics...
Страница 31: ...31...
Страница 34: ...34 What You Will See...
Страница 36: ...36 LED Not Lighting Up Make sure you connect the LED correctly or try other LEDs...
Страница 38: ...38...
Страница 39: ...39...
Страница 49: ...49...
Страница 53: ...53 You should see numeric values print out in the monitor Turning the potentiometer changes the value...
Страница 58: ...58...
Страница 62: ...62...
Страница 65: ...65...
Страница 66: ...66...
Страница 72: ...72 jumper wire or reverse the buzzer...
Страница 75: ...75...
Страница 76: ...76...
Страница 81: ...81...
Страница 85: ...85 digitalWrite greenled LOW digitalWrite yellowled LOW Press the button to turn corresponding LED on and off...
Страница 88: ...88 In this experiment we use a common cathode display Below is the seven segment pin diagram...
Страница 90: ...90 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 93: ...93 seven segment display corresponding pin A G and DP and then each foot in a 220 ohm resistor in series...
Страница 94: ...94...
Страница 101: ...101...
Страница 102: ...102 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 103: ...103...
Страница 107: ...107 if c 9 b c 0 if b 9 a b 0 if a 9 a 0 b 0 c 0 d 0 void WeiXuan unsigned char n...
Страница 117: ...117 Troubleshooting No number jumping on 4 digit Segment Check out the wiring between the 1 digit LED display and REV4...
Страница 120: ...120 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 121: ...121...
Страница 129: ...129...
Страница 134: ...134...
Страница 137: ...137...
Страница 138: ...138...
Страница 142: ...142 turns on if greater than 30 red LED turns on...
Страница 146: ...146...
Страница 149: ...149 Serial println DHT temperature 1 delay 1000 What You Will See...
Страница 154: ...154 analog pin As shown below...
Страница 155: ...155 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 156: ...156...
Страница 161: ...161 Note that here use a 10K Resistor...
Страница 164: ...164 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 165: ...165...
Страница 172: ...172...
Страница 173: ...173...
Страница 179: ...179...
Страница 180: ...180...
Страница 184: ...184...
Страница 189: ...189 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 194: ...194 What You Will See...
Страница 197: ...197...
Страница 201: ...201...
Страница 202: ...202...
Страница 206: ...206...
Страница 207: ...207...
Страница 211: ...211...
Страница 212: ...212 pay attention to using the NPN 8050 transistor the plug direction of 4N35 relay and diode Upload Code...
Страница 218: ...218 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 219: ...219...
Страница 223: ...223 What You Will See Move your hand or a large flat object closer and farther away from the...
Страница 230: ...230...
Страница 232: ...232 Once you re finished it s time to build the circuit...
Страница 237: ...237...
Страница 238: ...238 Circuit Diagram...
Страница 247: ...247...
Страница 250: ...250...
Страница 258: ...258...
Страница 262: ...262...
Страница 269: ...269...
Страница 271: ...271 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 272: ...272 Circuit Diagram...
Страница 282: ...282...
Страница 284: ...284 Hookup Guide Check out the circuit diagram and hookup table below to see how everything is connected...
Страница 285: ...285...
Страница 293: ...293...
Страница 296: ...296 Fennie keyestudio com Thank you in advance...