November 23, 2024, 02:28:00 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Battery monitor using BS2

Started by pbronson, November 22, 2013, 02:21:15 PM

Previous topic - Next topic

pbronson

I am attempting to build a remote battery monitor using a BS2 and Xbee. The program works well for one battery but I would like to monitor two. I have attempted to change the code to read the output on pin 1 in addition to the existing pin 0 but am unable to get it to work properly and would like any suggestions and or code.

The program is as follows:

rct var word ' RCtime value
Vx var word ' voltage value calculated
' we want this to = applied voltage Vx
Cn1 con 48576 ' first constant, see below
Cn2 con 8 ' second constant, ditto
' circuit attached to P0
low 0
loop:
RCtime 0,0,rct
low 0
Vx=Cn1 / rct + Cn2
debug home,dec? rct,"Vx=",dec Vx/10,".",dec1 Vx
pause 500
goto loop


This is from emesystems.com and I did attempt to contact them for suggestions to no avail.

Thank you in advance for any help. I am a rank newbie....

Pete

P.S. The article is at www.emesystems.com/BS2rct.htm

JonnyMac

May I suggest you use P14 and P15 instead? The reason is that you'll want to remove the ULN2803 from the circuit that is doing an RCTIME command. 

Have a look at this thread:
-- http://www.efx-tek.com/php/smf/index.php?topic=130.0
Jon McPhalen
EFX-TEK Hollywood Office

pbronson