tester

Use of cookies

We use cookies to improve and analyse your browsing experience on our web. You can accept these cookies, reject them or choose your settings by clicking on the corresponding buttons. Please note that rejecting cookies may affect your browsing experience. For more information you can consult our Cookies policy.

Configure cookies

Cookies are an essential part of how our web works. The main goal of cookies is to make your browsing experience more comfortable and efficient and to improve our services and the web itself.
Here you can find all the information about the cookies we use and you can activate and/or deactivate them according to your preferences, except for those cookies that are strictly necessary for the operation of the web. Blocking some cookies may affect your experience on the web and how the site works. For more information you can visit our Cookie Policy.

Strictly necessary (technical) cookies

These Cookies are necessary for the web to function and cannot be disabled on our systems. They are generally only set up in response to actions you may take such as requesting services, setting your privacy preferences, logging in or completing forms. You can set your browser to block or warn you about these cookies, but some parts of the web will not work. Information about Cookies.

Analytical cookies

These Cookies allow us to count the number of visits and traffic sources so that we can measure and improve the performance of our site. They help us to find out which pages are the most popular and least popular, and to see how visitors move around the web. All information collected by these Cookies is aggregated and therefore anonymous. If you do not allow these Cookies we will not know when you visited our web. Information about Cookies.

Third party cookies

These cookies are used to analyse your activity in order to show you personalised advertisements. Information about Cookies.

Accept Decline Configure cookies Confirm selected
Search
×
Notes
Search
There are no notes
  • 4. Arduino board: programming robots
  • To customise Pencil press Alt + Down Arrow
  • To customise Highlighter press Alt + Down Arrow

    Change theme

    Error - please check your internet connection...
    Back

    Blink Help

    x
    Error - please check your internet connection...

    How can we help you?

    No results

    View full manual

    Couldn't find what you were looking for?

    Please describe the issue you are experiencing and provide as many details as possible. Let us know the book, class, access device, licence code, username, used browser or if it occcurs in our app:

    Thickness:
    Font size:
    Filter
      No resources found
      Font size:
      Revision mode

      Revision mode

      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 25

      How should we modify the program if we want the LED to stay on for twice the amount of time?

      • For the LED to stay off twice the amount of time the first delay must be changed from delay(1000) to delay(2000).

      • Correct answer
        Wrong answer
      • For the LED to stay on twice the amount of time the first delay must be changed from delay(1000) to delay(2000).

      • Correct answer
        Wrong answer
      • For the LED to stay on twice the amount of time the first delay must be changed from delay(1000) to delay(500).

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

       

      How should we modify the program if we want the LED to blink quickly three times and then blink slowly once?

      • For the LED to blink quickly three times and then blink slowly once the void loop() needs to changed to the following:

        void loop() {

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        // and now more slowly

        digitalWrite(pinLED, HIGH);   delay(2000);

        digitalWrite(pinLED, LOW);   delay(2000);

        }

      • Correct answer
        Wrong answer
      • For the LED to blink quickly three times and then blink slowly once the void loop() needs to changed to the following:

        void loop() {

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        // and now more slowly

        digitalWrite(pinLED, LOW);   delay(2000);

        digitalWrite(pinLED, LOW);   delay(2000);

        }

      • Correct answer
        Wrong answer
      • For the LED to blink quickly three times and then blink slowly once the void loop() needs to changed to the following:

        void loop() {

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        digitalWrite(pinLED, HIGH);   delay(500);

        digitalWrite(pinLED, LOW);   delay(500);

        // and now more slowly

        digitalWrite(pinLED, HIGH);   delay(2000);

        digitalWrite(pinLED, LOW);   delay(2000);

        }

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 26

      What command is used to turn on the LED?

      • digital 13 on

      • Correct answer
        Wrong answer
      • digital 13 off

      • Correct answer
        Wrong answer
      • think on! for 1 second

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

       

      What command makes the LED wait for one second?
      • think mmm... for 1 second

      • Correct answer
        Wrong answer
      • think on! for 1 second

      • Correct answer
        Wrong answer
      • digital 13 on

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 27

      Design a program to control the LED ‘traffic light’ in the photo.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 28

      Build the following circuit, connecting a buzzer to the 8th pin of an Arduino board. Open the example toneMultiple from File >Examples >Digital and check the result. Explain here your steps.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 29

      How can we add a sound effect to the traffic light when it is red? Your work in the two previous activities will help you.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 30

      How could we use these sensors to detect when someone enters a room?

      limit switch

      PIR presence sensor

      magnetic proximity switch

      clinometer
      push button

       

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 31

      How would you connect a clinometer to an Arduino board? Explain the drawing.

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 32

      Modify the program that controls the series port. When you push the button, the message “You are pushing me” should appear on the screen.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 33

      Build the circuit that is described in this section in the simulator 123d.circuits.ico (Computer application section). Try using the series port, too.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 34

      Add a second LED to the example on the previous page. This second LED should blink when the button is pushed. The first LED should blink when the button is released.

      Control program :

      const int   pinPushbutton = 3; // we define the pins

      const int   pinLED = 13;

      int   pushbuttonOn; // variable that stores the state of the push button

      void setup() {

           // we configure inputs and outputs

           pinMode(pinLED, OUTPUT);

           pinMode(pinPushbutton, INPUT);

      }

      void loop(){

           // we read the state of the push button

           pushbuttonOn = digitalRead(pinPushbutton);

           // if pressed we switch on the LED

           if (pushbuttonOn == HIGH) {

               digitalWrite(pinLED, HIGH);

      }

        else {

           // if not pressed we switch it off

           digitalWrite(pinLED, LOW);

        }

      }

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 35

      For the command below, what will the digital value of temp be if the analogue temperature input is 25 °C?

      temp=analogRead(A0);
        51
      LM35 sensor connected to an Arduino board

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 36

      In a square wave pattern, the electrical tension has two values over time. If the signal is periodic, the form is repeated continually with a periodicity of T. What is the frequency (f) of this signal? (f(Hz) = 1/T)

        5l

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 37

      What will be the value of lightLED for valuePot = 205?

      lightLED = map(valuePot, 0,1023, 0,255);

      The command map assigns lightLED a value between 0 and 255. This is proportional to valuePot, which ranges from 0 to 1023.

      • 205

      • Correct answer
        Wrong answer
      • 255

      • Correct answer
        Wrong answer
      • 51

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 38

      What will happen to the LED if we replace the voidloop() function with the commands in the margin?

      void loop() {

          for (int lightLED = 0; 

          lightLED <= 255; lightLED += 5) {

          analogWrite(pinLED, lightLED);

          // we wait 25 milliseconds:

          delay(25);

         }

      }

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 39

      Draw a 50 Hz PWM signal with a work cycle (ton/T) 25%.
      Send your drawing to your teacher. My file is called

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 40

      Calculate the power that the battery supplies, the power that the transistor consumes, and the power used by the motor. Which transistor would you choose?

      Transistor

      VCE

      TIP120

      0.8 V

      IRF540

      0.1 V

       

      PBATTERY = V · I

      PMOTOR = VMOTOR · I = (6 – VCE) · I or PMOTOR = PBATTERY – PTRANISTOR

      PTRANSISTOR ≈ VCE · I

      To calculate the power consumption for each load use the formula P = VI, we will assume that I = 200mA

       

      Using TIP120

      Using IRF540

      PBATTERY

      mW

      mW

      PTRANSISTOR

      mW

      mW

      PMOTOR

      W

      W

        160 1180 20 1200 1040

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 41

      Which switches must you use to control the direction of rotation of the motor in this diagram?

      • For the motor to rotate in one direction we need to turn on S1 and S4. For the motor to rotate in the opposite direction we must turn on switches S2 and S3.

      • Correct answer
        Wrong answer
      • For the motor to rotate in one direction we need to turn on S1 and S2. For the motor to rotate in the opposite direction we must turn on switches S3 and S4.

      • Correct answer
        Wrong answer
      • For the motor to rotate in one direction we need to turn on S1 and S3. For the motor to rotate in the opposite direction we must turn on switches S2 and S4.

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

       

      What would happen if we turned on S1 and S3 at the same time?

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 42

      Draw the shape of a signal that leaves the axis at 45 degrees.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 43

      Look at the servomotor above. What does it do?

      #include <Servo.h>

      //Name of servo:

      Servo myServo;

       

      void setup(){

        //Connected to pin 9:

           myServo.attach(9);

      }

       

      void loop(){

           myServo.write(0);

           delay (4000);

           myServo.write(180);

           delay (4000);

      }

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 44

      Complete the circuit and control program for an electric gate that controls access to a car park.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 45

      Find out if a sweep servomotor can be converted into a continuous rotation servomotor, and how to do it.

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 46

      How far away is the object if t = 1 ms?

      speed (v) = 343 m/s

      Write here your calculations

      Result: distance= mm

        171.5 2l

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 47

      Use the function t=pulseIn(pin, HIGH) to measure the time in microseconds. Explain where the following equation comes from: distance=0.017*time.
      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 48

      How would you design a robot that avoids obstacles as it moves around? What would you add to the previous program?

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 49

      How does this sensor detect the presence of an obstacle?

      • They emit an infrared ray of light that is reflected on an object and is detected by an LED.

      • Correct answer
        Wrong answer
      • They emit an infrared ray of light that is reflected on an object and is detected a phototransistor.

      • Correct answer
        Wrong answer
      • They emit an electric signal that is reflected on an object and is detected a phototransistor.

      • Correct answer
        Wrong answer
      El sensor CNY70 incorpora un LED y un fototransistor.

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 50

      How can a robot follow a black line painted on a white floor?

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 51

      An encoder lets us measure the speed of a rotating wheel. Can you guess how it works?

      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 52

      How does the robot work?

       
      • The robot constantly performs the following actions: advances for 2 seconds, if it receives more light on the left turns in that direction and if it receives more light on the right side it turns right.

      • Correct answer
        Wrong answer
      • The robot constantly performs the following actions: advances for 1 second, if it receives more light on the left turns in that direction and if it receives more light on the right side it turns right.

      • Correct answer
        Wrong answer
      • The robot constantly performs the following actions: advances for 1 second, if it receives more light on the left turns right and if it receives more light on the right side it turns left.

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

       

      How would you make a photophobic robot?

      • Changing the direction of rotation of the motors when light falls on the robot. If more light is present on the left side should turn right and vice versa.

      • Correct answer
        Wrong answer
      • The robot is already photophobic, so we don't need to change anything.

      • Correct answer
        Wrong answer
      • Changing the circuit by adding an optic sensor.

      • Correct answer
        Wrong answer

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 53

      Write a control program for an LDR-guided robot.
      (0 words)

      Done
      4. Arduino board: programming robots
      Programming and robotics
      Without background sound
      Logo

      Activity 54

      Could we replace the LDR with mechanical position sensors? How would the circuit change?

       
       
      • The circuit would remain the same.

      • Correct answer
        Wrong answer
      • We could replace the LDR with mechanical position sensors. These sensor would detect the object on hitting it, not before.

      • Correct answer
        Wrong answer
      • The program would need to be changed so that the robot detects an object hitting it, turning right if the object hits the left sensor and vice versa.

      • Correct answer
        Wrong answer
      • The program would need to be changed so that the robot responds accordingly.

      • Correct answer
        Wrong answer

      Done

      ,
      You have completed the lesson!

      Below is the time you have spent on the activity and the score you obtained.

      Time spent

      Score

      1. 1
      2. 2
      3. 3
      4. 4
      5. 5
      6. 6
      7. 7
      8. 8
      9. 9
      10. 10
      11. 11
      12. 12
      13. 13
      14. 14
      15. 15
      16. 16
      17. 17
      18. 18
      19. 19
      20. 20
      21. 21
      22. 22
      23. 23
      24. 24
      25. 25
      26. 26
      27. 27
      28. 28
      29. 29
      30. 30
        Eraser
        Rich text editor
        close