Keypad Comms
Posted: Sun Apr 22, 2018 7:31 pm
Hi Guys,
I'm just about to attempt direct keypad integration into the M1 using build, however I'm new to the whole CAN side of things though.
So far i have the following:
I dont believe its right though, and i was hoping someone would be able to assist..
I have the list from the racegrade manual in relation to the can specs:
e.g.
Channel, Offset, Length, Bit Mask, Divisor
Button 1, 0, 1, 0x01, 1
Button 2, 0, 1, 0x02, 2
And i also know the can baseID's:
NODE ID = 0A
BUTTON ADDRESS = 0506
LED ADDRESS = 0507
BRIGHTNESS ADDRESS = 0508
I have watched the webinars online, but im confused with the bitmasking side of things.
I was hoping someone that's done it before can point me in the right direction with the CAN stuff.
I'm just about to attempt direct keypad integration into the M1 using build, however I'm new to the whole CAN side of things though.
So far i have the following:
- Code: Select all
local channel1 = true;
local h = CanComms.RxOpenStandard(0, 0x506, 0x01, true);
local received = CanComms.RxMessage(h);
if (received)
{
local id = CanComms.GetID(h);
Buttons.Button 1.Channel = id;
if (id eq 0x506)
{
channel1 = CanComms.GetBit(h, 1);
}
}
I dont believe its right though, and i was hoping someone would be able to assist..
I have the list from the racegrade manual in relation to the can specs:
e.g.
Channel, Offset, Length, Bit Mask, Divisor
Button 1, 0, 1, 0x01, 1
Button 2, 0, 1, 0x02, 2
And i also know the can baseID's:
NODE ID = 0A
BUTTON ADDRESS = 0506
LED ADDRESS = 0507
BRIGHTNESS ADDRESS = 0508
I have watched the webinars online, but im confused with the bitmasking side of things.
I was hoping someone that's done it before can point me in the right direction with the CAN stuff.