| Servo Cable Color | Header Socket Label |
|---|---|
| brown or black | GND |
| red | VOUT |
| orange, yellow, white, or blue | A1 |
This program below turns your device into a robot because it performs the “sense-think-act” cycle that all robots do by reading the temperature sensor (sense), calculating how fast to spin the servo based on that temperature (think), and then sending a signal to the servo motor to make it spin at an appropriate speed (act).
Copy the code below to your device and run it by clicking the "Save" button. The motor will be off or spinning slowly at low temperatures (such as ambient room temperature) and will spin rapidly at higher temperatures (like when you touch the temperature sensor with a finger and heat it up).
It is your job to trace the remaining above program and identify what lines represent the SENSING, THINKING, and ACTING for this robot.
Note: Your temperature and RPM may vary from the image below depending on the room temperature.
After you review the program and locate the relevant lines, you must explain to your instructor which parts of the code perform the Sense, Think, and Act steps. Be specific by referencing the line numbers. This explanation is required and is part of your grade!
Verify this with your instructor. This is part of your grade! You must complete all the robot activities before the end of Lab 3.