Before programming
Use the tool tab on the top to check whether we are using the correct breadboard, processor and port type. Basic program tutorials are written inside Arduino itself, so if we need any reference, we can simply open the examples for help.
Programming Syntax
Initializing the pins
- We first have to decide whether a pin is an input or output by writing pinMode(#num, OUTPUT) or pinMode(#num, INPUT).
- The syntax for the function is
void setup() {
}
Loop function
- Loop function iterates forever until it stops and its syntax is:
void loop() {
}
Delay function
- delay(time) NOTE: time is in milliseconds
Turn on/off LED
- Turn on the light: digitalWrite(#pinnum, HIGH)
- Turn off the light: digitalWrite(#pinnum,LOW)
After programming
After programming the codes, use the sketch menu on the top bar and click the compile button. After compiling, we click the upload button to transmit our program to the breadboard to execute our code.