My current arm is conroled via joystick, and I don't want that functionality to go away. However, I'd like to be able to have the user switch to using bluetooth.
I'm having a problem with coding this though.
Even when I comment out my joystick analog reads (which is necessary for controlling my robot, as I center the analog read and then scale it for geometric use later).
But when I try to do an analog read of the HC-06, it doesn't translate so easily. Is it possible to do accurate analogReads of the bluetooth joystick? Does it need to be centered differently?
My wiring:
GND -> GND).
VCC -> 5v.
TX/TXD -> Analog 14
RX/RXD -> Analog 15
//TX/TXD -> 4.
//RX/RXD -> 2.
This is an example of what I do with my joystick x and y position readings, just to show that I'm manipulating them later:
pos_X_2 = (analogRead(X_pin_2) - 512.0);
pos_Y_2 = (analogRead(Y_pin_2) - 512.0);
scale(pos_X_2);
scale(pos_Y_2);