Here is what I get out of the doc. You need to send the controller a
command and it will send you a response. If you want to get the Battery
voltage you need to send it
5B 04 39 00 00 98
If the battery voltage is 48v it should send you back.
5B 04 39 01 D4 plus some unknown hex value (the next byte in memory) and a
checksum. O1 D4 is the voltage reading. That is .1025 volts per bit so
48/.1025 ~ 468 decimal or 1D4 hex.
The trick is that these are hex values. If you want to sit down at your PC
and open something up to talk to the controller, the built in application is
Hyperterminal. However this is a terminal emulation program and most
terminal emulation packages send some sort of ASCII, so you can't just type
in 5B 04 39 00 98 because these will get converted to their ASCII
hexadecimal values and sent to the controller. There is probably some sort
of escape character sequence you can use to send hex, but I don't know it
off the top of my head. It may be well documented someplace and easy to
figure out, I have just never had a need.
On the other hand doing this with your BS2 will be pretty straight forward.
I'm not at a machine with a the parallax softwar installed, so I don't have
the docs handy to look up the exact command, but you just wire up a couple
of pins to the proper RS232 pins then use the pBasic commands to send and
receive a serial string. There is a ton of Parallax documentation on doing
this exact thing, so I would just go with that. If you have your BS2 hooked
up to your PC while you are doing it you can use the debug window to
actually see the values.
damon
From: Mike <[EMAIL PROTECTED]>
Reply-To: ElectricMotorcycles <[email protected]>
To: ElectricMotorcycles <[email protected]>
Subject: [ElectricMotorcycles] Polling the Alltrax
Date: Fri, 2 Dec 2005 09:29:41 -0500
Okay, here's something that will show my ignorance. How do you use this
info? Let's say I hook up my beloved Alltrax to my PC and want to read
throttle position (just as an example).
; 04h = READ RAM - This command fetches three sequential bytes of
information
; from RAM (variable) memory and sends it to the Windows
host.
; variable locations are organized in order to minimize
; the number of read cycles needed to refresh data.
--
The Electric Motorcycle Portal
http://www.electricmotorcycles.net/
Electric Motorcycle Listserv
http://www.electricmotorcycles.net/listserv