long deadManInterval = 110; // milisecs interval between
if(mySerial.available()) { // data received from smartphone
deadManTimeout = false;
delay(2);
cmd[0] = mySerial.read();
if(cmd[0] == STX) {
int i=1;
while(mySerial.available()) {
delay(1);
cmd[i] = mySerial.read();
if(cmd[i]>127 || i>7) break; // Communication error
if((cmd[i]==ETX) && (i==2 || i==7)) break; // Button or Joystick data
i++;
}
if (i==2) getButtonState(cmd[1]); // 3 Bytes ex: < STX "C" ETX >
else if(i==7) getJoystickState(cmd); // 6 Bytes ex: < STX "200" "180" ETX >
}
}
if(deadManEnabled) checkDeadMan();
sendBlueToothData();
}
void checkDeadMan() { // stop chair if signal is lost
static long previousMillis = 0;
long currentMillis = millis();
if(currentMillis - previousMillis > deadManInterval) { // send data to smartphone
previousMillis = currentMillis;
if(deadManTimeout) {
BT_Steering = 127; //neutral
BT_Throttle = 127;
Rapidity=127; // Set to HALT value ...
buttonPresses=1; // Arduino and Android phone defaults to HALT after signal loss.
displayStatus = "***!HALT***"; // for debug only
digitalWrite(BTled,LOW);
int joyX = 200; // Offset to avoid
int joyY = 200;
delay(2);
}
else
digitalWrite(BTled,HIGH); // BT Connected indication.
woodygb wrote:NOTE:- That FTDI has recently updated it's driver and the Chinese copies will not work with it ... you need to use an earlier version of the driver.
https://blog.adafruit.com/2016/02/08/ex ... -adafruit/
woodygb wrote:I can supply the various interfaces.
Top right is a HOMEBREW "DWIZ-ADAPT" based on a electronic sketch supplied by Anubis... the other... top left is the Rhino 2 adapter..
NOTE:- You WILL need the modified Wizard 5 software .
calabash wrote:Hello Woody
Just bought a quickie salsa R2 with a VR2 joystick, will this lead work? If so yes I will have one please then just need to be pointed to the software.....
Cheers.
Return to Buy/Sell Mobility Equipment
Users browsing this forum: No registered users and 9 guests