Professional Documents
Culture Documents
setCursor (0,0);
lcd.print (“ “);
1. LED
- longer side (+) – resistor – digital pin 7. PUSHBUTTON SWITCH (pullup)
- shorter (-) – ground
2. POTENTIOMETER
- 1st – voltage input – 5V
- 2nd – analog pin (A0)
- 3rd – ground
3. PHOTORESISTOR
1 = w/o current 0 = w/current
*If pull down resistor, resistor is on GND side.
0 = w/o current 1 = w/ current
8. SOUND/NOISE SENSOR
4. RGB LED
- RBG (TinkerCad)
loop: - (+) – 5V
lcd.init (); - (-) - ground
lcd.backlight ();
FUNCTIONS STRUCTURES
1. pinMode 1. if
- pinMode (pin, OUTPUT/INPUT); - if (condition){
//statements
2. digitalWrite }
- digitalWrite (pin, HIGH/LOW)
2. for
3. delay - for
- delay (milliseconds); (initialization;condition;increment){
// statements
4. analogWrite }
- brightness/speed (0-255)
- analogWrite (pin, 0-255) 3. while
- while (condition){
5. analogRead // statements
- 0 – 1023 increment
- analogRead (pin); }
3. long 5. do .. while
- > 32 768 - do {
- long var = val; // statement
increment
4. String
- String var = val; } while (condition);
5. byte
- byte var = val; ● SERIAL MONITOR
6. char setup:
- char myChar = ‘val’; //single quote Serial.begin (9600);
- char myChar = val; //ASII Chart
loop:
Serial.print ();
variable = Serial.parseInt ();
variable = Serial.parseFloat ();
variable = Serial.readString ();