Hey, I have a circuits@home USB Host shield, and I have some programming difficulties.
The steering is working fine, but now I am struggling to make the motor and lights.
I am using the PS3 Bluetooth library - developed by Kristian Lauszus.
First problem, the lights. I wan’t to make the RIGHT button to toggle the lights that are in pin 4. I know how to make a toggle button(wired), but how I can make it work with the “PS3.getButtonClick(RIGHT)”?
Second problem, I need to output PWM from the pins 5 and 6 to the motor. Since I am using a H-bridge, the outputs absolutely must not go high at the same time. And I want the right analog stick to control the speed (Y-axis). The output has to start from like 30% duty cycle, so everything under 160 must be 0(input range of 0-255 and out “160-255”). The CIRCLE button would toggle between reverse and forward. How I can get a editable number out of the “PS3.getAnalogHat(RightHatY)”
I have tried this
if(RightHatY < 150)
LeftHatY = 0;
But I get this error “lvalue required as left operand of assignment”.
I have tried to google a solution for this but i have not found answers.
First post here
auto_BT.ino (4.24 KB)