| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /*
- * This is the Arduino code for an:
- * Infrared Obstacle Sensor and displaying the time on 6 digital display and serial monitor.
- * Uses preprogrammed distance and converting it into mph.
- ***Still needs to count and store laps for average #of laps once button press
- ***Still needs to use 2 digit separate display the lap count for the above laps once button press
- IR Sensor Wiring:
- Brown: 5V DC
- Blue: GND
- Black: Signal, to PIN 3
- Arduino pins to the Large Digit Driver IN
- Arduino pin for SPEED DISPLAY
- 6 -> CLK (GREEN)
- 5 -> LAT (BLUE)
- 7 -> SER on the IN side (YELLOW)
- 5V -> 5V (ORANGE)
- Power Arduino with 12V and connect to Vin -> 12V (RED)
- GND -> GND (PURPLE)
- 8 -> Push Button
- START Input
- Arduino pin for LAP DISPLAY
- 11 -> CLK (GREEN)
- 10 -> LAT (BLUE)
- 12 -> SER on the IN side (YELLOW)
- 5V -> 5V (ORANGE)
- Power Arduino with 12V and connect to Vin -> 12V (RED)
- GND -> GND (PURPLE)
- */
- //GPIO declarations
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- const byte segmentClock = 6;
- const byte segmentLatch = 5;
- const byte segmentData = 7;
- const byte segmentClockLAP = 11;
- const byte segmentLatchLAP = 10;
- const byte segmentDataLAP = 12;
- const byte button = 2;
|