MrDEB
Well-Known Member
My neighbor is constructing a "man cave" with a hot rod, fast car theme (old gas pump front panel, drag slick, stop light etc.
I got crazy idea to build a Chrondike Christmas Tree (a "tree" used in drag racing indicating when to leave the starting line. The starting line utilizes clocks to measure drivers reaction time)
Reaction time is measured how fast a driver gets their car moving after the green light on the tree comes on.
So I wrote a short code to begin a reaction time that is displayed on an LCD. This is a crude start and for a better clock to use TMR1 and interrupts.
So a work in progress. End project to utilize 12v Leds using mosfets.
I got crazy idea to build a Chrondike Christmas Tree (a "tree" used in drag racing indicating when to leave the starting line. The starting line utilizes clocks to measure drivers reaction time)
Reaction time is measured how fast a driver gets their car moving after the green light on the tree comes on.
So I wrote a short code to begin a reaction time that is displayed on an LCD. This is a crude start and for a better clock to use TMR1 and interrupts.
So a work in progress. End project to utilize 12v Leds using mosfets.
DEVICE = 18F4321
CLOCK = 8
CONFIG MCLRE = off
// some LCD options...
#option LCD_DATA = PORTD.4
#option LCD_RS = PORTd.0
#option LCD_EN = PORTd.1
// import LCD library...
INCLUDE "SetDigitalIO.bas"
INCLUDE "IntOSC8.bas"
INCLUDE "LCD.bas"
INCLUDE "utils.bas"
'INCLUDE "Keypad16pullup.bas"
INCLUDE "Convert.bas"
DIM blue AS portB.7
DIM green AS portb.5
DIM button AS portb.4
DIM time AS WORD
DIM start AS portb.0
time = 0
setalldigital
OUTPUT (blue)
OUTPUT (green)
INPUT(start)
cls
DELAYMS(50)
blue =1
green = 1
start = 1
WHILE true
blue = 0
DELAYMS(3000)
blue = 1
green = 0 //go
REPEAT
INC (time)
UNTIL button = 0
green = 1
WriteAt(1,1,"reaction=",DecToStr(time),"ms",2)
DELAYMS(3000)
time = 0 //reset to zero
WEND