[Ovmsdev] Volt/Ampera

Michael Balzer dexter at expeedo.de
Thu Feb 7 06:12:10 HKT 2013

Hi Michael,

Am 06.02.2013 13:10, schrieb mikeljo at mac.com:
> witch bits is now what?
> My understanding is that the MSB is "FrontLeftDoor" and the LSB is 
> "CarON".

My fault, I should have added a remark.

The original bit values are documented in the "OVMS Protocol" document 
(environment message).

"OVMS Development" adds: PIC18F is little endian, i.e. [...] Bit fields 
are packed right to left

So, it's LSB first, 0x01 .. 0x80.

> I think it is better to use the bits direct. Like this: 
>  car_doors1bits.ChargePort = 1

"Better" will be dependant on your concrete needs. I like to be able to 
access single bits like this due to better readability.

But if you need to set or query a larger group of bits, the combined 
byte value will be more readable and perform better.


Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20130206/fc8ca525/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dexter.vcf
Type: text/x-vcard
Size: 206 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20130206/fc8ca525/attachment-0002.vcf>

More information about the OvmsDev mailing list