Fundamental of Electronics
- Resistor x 6+
- LED X 6+
- Breadboard x 1
- Wires
Arduino Programming Language
- int: Variables/Data Types
- begin(): function/communication/serial
- println(): function/communication/serial
- pinMode(): Functions/Digital I/O
- digitalWrite():Functions/Digital I/O
- delay(): functions/Time
- if: Structure/ control structure
- else: Structure/ control structure
- Comparison operators:
Task 1 Develop a program to show the for loop iteration process. This can be achieved by preforming a mathematical increment from 0 to 100 by step 5. When the value equal to 100, it will restart the increment from 0. Use serial monitor tool to display the value of each increment for o1 second.
Objectives of practice:
- Understanding the operation of iteration
- Practice with compound operator
- Practice with for loop
- Task 1 Advance practice: use more efficient coding method to perform the same task
Task 2 Develop a program and the circuit to control the switch of 6 LEDs. Each LED switch on for 1 s respectively in order. For loop must be used for the LEDs selection and switch iteration.
Objectives of practice:
- More practice with for loop
- More practice with compound operator
- Understanding the operation of iteration
Task 3 Modify the program to develop a different pattern of switch control for the 6 LED:
- Each LED will switch on andremaining on state until all LED switch on. Then all LED will switch off together. Then repeat the process.
- Each LED will turn on and then off, then repeat respectively in one direction until the last LED. Then switch the direction and repeat the process.
- The LED will switch on in one direction and remaining on state until all LED switch on. Then the LED will switch off from another direction until all LED switch off. the process will continue repeat.
Objectives of practice:
- More practice with for loop
- More practice with iteration operation
- More practice with Compound operators.