As in the Picutre attached i identified the row 00000140 being in charge of the cars lights. As soon as i engage my turn indicators, the third byte Changes from 01 to 06 (00000101).
Then when i engage the right indicators, it changes to 09 (00001001)
Can someone show me how the Frame of this would need to look like? I tried my best using a code snippet i found on the forum from a BMW, but it contained a parameter named “conversion” which i just don’t get yet.
Then looking at your example; you will need something like
your frameID will be; frame id=“0x140”
Left Indicator;
offset="2"
length="1"
units="bit"
conversion="V & 6 >> 2"
Right Indicator
offset="2"
length="1"
units="bit"
conversion="V & 9 >> 3"
Basically offset to get the byte position starts at 0, length of 1 means single byte or 8 bits, then the conversion uses BITWISE AND to capture the bits required then shifts the bit you need to the LSB position.
You really made my day, it worked the way you told me
Just one more question: If i would like to assign the Value “10” (which is the high-beam), what changes would i need to do to offset and length?
Im am aware that i need to change the TargetID and Conversion value, i got that now, thank you so much for clearing the fog inside my decimal calculating brain
Talking about offset and length, i marked them yellow blue and orange.
Since you figured out that Value “01” is offset 2, i believe that value “10” would be offset 0, is that right?
or is it interpreted right from left and therefore “Length 1” is the orange, and Length 3 would be yellow for high beam?
one more thing:
The Indicator now shows in realdash, but id doesnt flash, its just constant on, Any easy way to make it flash?
the byte order is B0, B1, B2, B3, B4, B5, B6, B7 therefore offset refers to the byte position, the lenght is how many bytes, but then it gets complicated as endianness then comes into play
The reason for the BITSHIFT is, if the targetID is only expecting a single bit (yes/no) then you need to move the bit to the LSB for it to work.
if offset 0 shows 00010000 highbeam off and 10110000 for on then bit 5 and 7 are changing to high, so this could be two things turning on, if turning the high beams on always turns bit 5 and 7 high then you could use either bit to set your TargetID;
offset=“0”
Length=“1”
conversion=“V>>5”
this would then look like this 10110000 >> 5 = 00000101
Amazing explanation, THANK YOU so much!
You are very aware, i like that. Apparently, when turning on my high beam, the low beams are getting on as well, thats the reason why 5 and 7 change
You really really helped me a lot, thank you so far, i hope one day i can revenge!
Here is what i got:
Car standing still without handbrake: :00000001
Car standing still with handbrake on: 00000000
Car driving with handbrake off: 00000010
So the reason why the light goes on again is because the first bit changes back to 0 again once its riding, but how can i get this done right?
i tried this earlier. The thing is that this way, the light stays on while handbrake is off. and car is at stop. As soon as i ride, the light goes off.
I just tried, issue remains. Its not actually reversed. The Problem is that the value Changes from
00000000 - Brake engaged, car is on hold
00000001 - Brake not engaged, car is on hold
00000010 - Brake not engaged, car is rolling
000000011 - Gear is in reverse
i think i need to specify the value of two bits to sort this out.
Ok, try this; the first bit doesn’t really count as the car is on hold (brake applied)
the second bit the car is moving (Brake off), we then need to ignore gear in reverse
offset="0" length="1" units="bit" conversion="~V & 2 >> 1"
this will mask the value and only select when the value is 2, then bitshift 1 right to get the LSB
tried that as well, with and without the ~
It works less good, if i remember right the sign remained off even with the brake engaged, and then it popped on once the car was moving.