Robotics Programming Worksheet_7
Robotics Programming Worksheet_7
Grade: VII
Subject: STEM
Topic: Robotics
Worksheet
Sketches:
_______________________________________________________________________________________
_______________________________________________________________________________________
Loops:
_______________________________________________________________________________________
_______________________________________________________________________________________
Q2. What is the difference between setup() function and loop() function in Arduino programming?
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q3. If you want to initialize any pin as digital input or output, which command will you use?
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q4(b). Write a code for defining pin for a LED which is connected with digital pin no. 13 of Arduino.
______________________________________________________________________________________
Q5(a). What is the difference between the terms variable declaration and variable initialization?
_______________________________________________________________________________________
_______________________________________________________________________________________
1
Block F Campus
Q5(b). How can we make variables in C++ (Arduino Programming)? Write a code for initializing
variable.
_______________________________________________________________________________________
Q6(a). Define Functions. How does function be useful in programming? Give advantages of making
functions in programming.
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q6(b). How can we make functions in Arduino C++ Programming? What is the purpose of void
keyword used in function?
_______________________________________________________________________________________
_______________________________________________________________________________________
Q7(a). Which part of robot should you have to deal if you want to drive your bot?
_______________________________________________________________________________________
Q7(b). Complete the configuration table for driving nimble bot.
Motor Right Motor Left Motor
ARDUINO PIN A0 7 4 8
STOP
RIGHT
FORWARD
LEFT
BACKWARD
Q9. What is Monitoring? Which function will you use to do serial monitoring?
_______________________________________________________________________________________
_______________________________________________________________________________________
Q10(a). Which keyword would you use if you want to import any external library to your code?
2
Block F Campus
_______________________________________________________________________________________
Q10(b). Which library will you import if you are making mobile controlled car project having
Bluetooth connection?
_______________________________________________________________________________________
Q10(c). Which library will you import for RGB LED (Disco lights)?
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q12(a). See the code below and answer the questions given below.
Q12(b). Observe the code given below and answer the following questions.
3
Block F Campus
a. The code is taken from diving nimble bot. Why analogWrite() function is used for pins RMS and
LMS while digitalWrite() function is used for rest of the pins?
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
b. Following the above code written for forward direction, rewrite the correct code for movement of the
robot in right direction.
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
c. What would happen if I revert all HIGH keywords in to LOW and all LOW commands into HIGH?
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________