Distance Tracker

Objective

Light up the correct LED with the distance

Code

Distance Tracker 1

Distance Tracker 2

Arduino Instructions

  1. Connect a wire from the 5V to the power rail and another from GND to the ground.
  2. Connect a wire from Vcc to the power rail.
  3. Connect a wire from GND to the ground rail.
  4. Connect a wire from Trig to pin 10.
  5. Connect a wire from Echo to pin 11.
  6. Connect a wire from pin 12 to B37.
  7. Take a green LED. Place the anode (long leg) of the LED in D37 and the cathode in D40.
  8. Connect a 330 Ohm resistor from B40 to ground.
  9. Connect a wire from pin 13 to B25.
  10. Take a red LED. Place the anode (long leg) of the LED in D25 and the cathode in D23.
  11. Connect a 330 Ohm resistor from B23 to ground.
  12. Now upload your code and move the sensor around.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: