Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handbrake #2

Open
armysolo opened this issue Feb 27, 2023 · 4 comments
Open

Handbrake #2

armysolo opened this issue Feb 27, 2023 · 4 comments

Comments

@armysolo
Copy link

I see that you have the bit data for the TSS Sparco handbrake. Does this support the handbrake natively? I've been looking into developing the I2C code to be able to use an Arduino to emulate an analog handbrake(non TM) to plug into the shifter to use on console port but it's a little out of my knowledge level.

I've already made a custom wheel button plate to replace my Sparco P310 wheel and it works greate so I do have some knowledge but I don't think I have enough to do this on my own.

@va1da5
Copy link
Owner

va1da5 commented Mar 12, 2023

Hey there! I stumbled upon the I2C capture on the racing forum. I've been trying out those bits via I2C and it seems to be working well. I even created min and max bytes arrays and tried them out while driving in Assetto Corsa, and it worked just as I expected! Upon further testing, I discovered that the 5th bit actually determines the strength of breaking - 0xFF means no break, while 0x00 means maximum break. I'm not entirely sure about the rest of the bits, so I just took them from the capture. Feel free to take a look at the arrays below!

uint8_t max[14] = {
    0x02, // TSS handbrake
    0x0C, // Unknown
    0x02, // Unknown
    0x01, // Unknown, 01 when max break
    0x00, // FF - no break, 00 max break
    0x7F, // Unknown ◄─┐
    0x1D, // Unknown ◄─│─┐
    0x7F, // Unknown ◄─┘ │
    0x1D, // Unknown ◄───┘
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00  // Unknown
};

uint8_t min[14] = {
    0x02, // TSS handbrake
    0x0C, // Unknown
    0x02, // Unknown
    0x00, // Unknown
    0xFF, // FF - no break, 00 max break
    0x80, // Unknown ◄─┐
    0x81, // Unknown ◄─│─┐
    0x80, // Unknown ◄─┘ │
    0x81, // Unknown ◄───┘
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00  // Unknown
};

@armysolo
Copy link
Author

armysolo commented Mar 12, 2023 via email

@Nemchenkan
Copy link

Today I have completed development Handbrake based on capture from the racing forum

First I have found correct parameters by changing firmware and flashing device, and after that I have found previous message from @va1da5... 🙄

I can confirm, that force of handbrake should be inverted and placed in to 5 bit of package (datatosend[4]).
I have used LoadCell + hx711

uint8_t datatasend[14] = {
    0x02, // TSS handbrake
    0x0C, // Unknown
    0x02, // Unknown I have used 0x05 - all works fine, think this deviceID
    0x00, // Unknown
    0xFF, // FF - no break, 00 max break
    0x80, // Unknown Changing have no affect for handbrake work
    0x81, // Unknown Changing have no affect for handbrake work
    0x80, // Unknown Changing have no affect for handbrake work
    0x81, // Unknown Changing have no affect for handbrake work
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00, // Unknown
    0x00  // Unknown
};

So, to use this in your code, you need to update handbrake force (inverted 0 - 100% force - ff or 255 - handbrake released) in datatasend[4] and resend datatasend[] in to 0x01 device of i2c of wheelbase.
Package should be sent every 250 milliseconds and on each handbrake force change.
All other data of datatasend[] can be sed from this message.

@afonsoreis
Copy link

Hi guys, unfortunately the forum is no longer working... does anyone have the code for Arduino to use a button or potentiometer as a handbrake??
Thank you a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants