Mock Paper Grade8 - Tee2 Practical
Mock Paper Grade8 - Tee2 Practical
1) Build a circuit using Arduino having 4 LEDs. Write code to make each of these LEDs
light up one at a time with a delay.Once all the LEDs are lit up,all of them should be
turned off for 1 second and the process should repeat. The program should be done
using array and for loop.
2) Create a circuit using Arduino having a LED and a push button such that the LED
should turn ON when the push button is pressed.Write the code and simulate using
Arduino IDE and Tinkercad.
3) Build a circuit using Arduino with 3 LEDs red,yellow and green to display the traffic light
signals. Write the code to make each of these LEDs light up one at a time with delay.
Write the code and simulate using Arduino IDE and Tinkercad.
4) Build a circuit using Arduino to display the message “ Computer science” on the LCD.
The LCD should also display the number of seconds since reset.Write the code and
simulate using Arduino IDE and Tinkercad.
5) The code given below has been used to measure the light in the immediate environment
using a photoresistor and flash a corresponding message on the serial monitor.
i) Find the errors and debug the code given below:
ii) Execute the sketch to show the intended output
int br=0;
Int val=0
Void setup(){
serial.begin();
}
Void loop()
{
br=digitalRead(A1);
val=map(br,0,600,0,2);
switch (br):
{
case0:
Serial.println(“Dark”);
break;
case1:
Serial.println(“Medium”);
break;
case2:
Serial.println(“Bright”);
break;
}
}
6) The code given below is used to make a LED fade in/fade out
.i) Find the errors and debug the code given below:
ii) Execute the sketch to show the intended output
int led=11;
int bright=0;
int fade=5;
void setup
{
pinmode(11,INPUT);
}
void loop
{
analogwrite(led,fade);
bright=bright+fade;
if (bright==256 || bright ==0)
{fade=-fade}
delay(100);
7) The code given below is used to make a LED fade in/fade out
.i) Find the errors and debug the code given below:
ii) Execute the sketch to show the intended output
rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3,
void setup()
lcd.begin(2,16);
lcd.println("hello, world!");
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.SETCursor(0, 1);
lcd.print(millis / 1000);
8) Build a circuit using Arduino such that the circuit should help in detecting the motion of
an object within a certain range(PIR sensor). Write the code and simulate using Arduino
and tinkercad.