Project Help
Hi there,
i need help in my project.
i have a homeworkboard with the bs2 and i need to find a way to get the input data to the computer (not by display but by txt or direct into another program)
·
i need help in my project.
i have a homeworkboard with the bs2 and i need to find a way to get the input data to the computer (not by display but by txt or direct into another program)
·
Comments
These all use the SEROUT / SERIN statements to send / receive data from a PC.
If you don't have anything yet other than an idea, you say so. You describe your idea as best you can, in as much detail as you can. Someone will make suggestions and/or ask questions. You take their suggestions and follow them if you choose, think about them at the very least. You answer any questions as well as you can, and report back with new thoughts and your own questions.
Post Edited (Mike Green) : 10/10/2009 1:11:14 PM GMT
NOTE i am farly good at pc progamming but need help on the bs2 end
cnt1 VAR Word
miles VAR Word
ten VAR Nib 'tenths
hun VAR Nib 'hundreths
flg VAR Bit '10th change flag
miles=0
ten=0
hun=0
SEROUT 14, 84, [noparse][[/noparse]22] ' start LCD 19200 baud
SEROUT 14, 84, [noparse][[/noparse]12] ' clear display
SEROUT 14, 84, [noparse][[/noparse]148,DEC3 miles,".",DEC ten,DEC hun]
STRT:
DO WHILE IN12=0 ' this handles the case of the wheel not rotating at all
LOOP
DO WHILE IN12=1 ' this handles the case if the wheel miraculously stops right on your sensor. In other words, we want a wheel revoltion count to be determined when the sensor passes, which is a change in state.
LOOP
cnt1=cnt1+2627 ' 10/1000ths multiplier (vary value for ODO wheel diameter)
IF cnt1/10000>1 THEN
hun=hun+1
cnt1=cnt1//10000
flg=1 ' set flag that determines if LCD is updated. i.e. no sense sending to LCD if nothing is different
ENDIF
IF hun>9 THEN
ten=ten+1
hun=0
ENDIF
IF ten>9 THEN
miles=miles+1
ten=0
ENDIF
IF flg THEN
SEROUT 14, 84, [noparse][[/noparse]148,DEC3 miles,".",DEC ten,DEC hun]
flg=0 ' reset flag after displaying
ENDIF
IF tflg THEN
GOSUB rdtemp
tflg=0 ' reset flag after displaying
ENDIF
GOTO STRT
These lines should not be there at the end.
IF tflg THEN
GOSUB rdtemp
tflg=0 ' reset flag after displaying
ENDIF
I also incorporated a temperature display on my ODO. Thanks for pointing that out.
Rick