
Time [s] Analyzer Name Decoded Protocol Result
0.028954833 Async Serial '0' (framing error)
0.332185917 Async Serial t
0.332471917 Async Serial '130'
0.332757917 Async Serial '133'
0.333043917 Async Serial '130'
0.333329917 Async Serial '128'
0.333615917 Async Serial '136'
0.333901833 Async Serial '205'
0.334187833 Async Serial '160'
0.334473833 Async Serial '128'
0.334759833 Async Serial '141'
0.335045833 Async Serial '15'
0.337132833 Async Serial '5'
0.337414417 Async Serial '128'
0.337695917 Async Serial '250'
0.339231667 Async Serial '15'
0.35215375 Async Serial `
0.352439667 Async Serial '191'
0.352725667 Async Serial '191'
0.353011667 Async Serial '255'
0.353297667 Async Serial '223'
0.353583667 Async Serial '128'
0.353869667 Async Serial '140'pinMode(JSIGPIN, OUTPUT);
// Dynamic Shark initialization sequence
// Bytes starting with (0x60) are Joystick in put data
// Bytes starting with (0x74) are initialization packets
// (0x0F) is the end packet notification, delays mostly 10ms till Joy has ( booted up ? 3.3seconds)
// then settles to a delay of 17.16ms
digitalWrite (JSIGPIN,HIGH); // Power button pressed On (from off state)
delayMicroseconds(293000);
digitalWrite (JSIGPIN,LOW);
delayMicroseconds(10.28);
// Fist packet of data sent from Joystick
Serial.write((0x74),(0x82),(0x85),(0x82),(0x80),(0x88),(0xCD),(0xA0),(0x80),(0x8D),(0x0F));
delayMicroseconds(1.527);
Serial.write((0x05),(0x80),(0xFA));
delayMicroseconds(1.406);
Serial.write(0x0F);
// delay till next group of data
delayMicroseconds(13.04);
// Second group of data
// Appears to be Joystick raw data reads/reads after interpretation by Wizard Software settings
Serial.write((0x60), (0xC0), (0xBF), (0xFF), (0xCD), (0x80), (0x8C), (0x80), (0xC8), (0x0F));
delayMicroseconds(2.32);
// Third group of data
// Inhibit files ? till joystick has booted up fully ?
// All inhibit bytes start with (0x61) and stop after 3.3seconds
Serial.write((0x61), (0x80), (0x80), (0xC0), (0x80), (0x80), (0x80), (0x80), (0xDE));
delayMicroseconds(.7155)
// End bits are (0x0F)
Serial.write(0x0F)
// now a cycle of Joystick (0x060), inhibit/raw/controller values (0x61) continues till 3.3seconds
// Then a steady stream of Joystick data with 17.16ms delay between bytes of data.
// Start bit, 8 data bits, End Bit
// Start bit (0x60) Address ?
// Bit 1 (0xC0) Y axis data
// Bit 2 (0xC0) X axis data
// Bit 3 (0xFF) Speed max setting
// Bit 4 (0xC0) Speed fine tune ?
// Bit 5 (0x80) Horn off/ 130on
// Bit 6 (0x8C) Joystick on ?
// Bit 7 (0x80) Chair mode (128drive/129tilt)
// Bit 8 (0xD4) Some other XY modifier ?
// End Bit (0x0F) End packet
// is 3.3 seconds of data packets necessary ?
// would not a "if bit 1 <>='192'(0xC0)" then inhibit enable ? surfice
#define INHPIN 11 // well its not used for testing this code as yet but will need inhibit at some point
#define JSIGPIN 1 // TX pin
#define LEDPIN 13 // Other output pin to connect to Jazzy line that pulses 255 all the time ?
#define pwrBtn 7 // On/Off button Digital Pin 4, has internal pull up resistor ? or was that pull down ?
unsigned char data[10];
unsigned long timer = 0;
int Ypin = A0;
int Xpin = A1;
int YpinValue;
int XpinValue;
int startYvalue = 192;
int startXvalue = 192;
void setup() {
// Dynamic Shark initialization sequence
// Bytes starting with (0x60) are Joystick in put data
// Bytes starting with (0x74) are initialization packets
// (0x0F) is the end packet notification, delays mostly 10ms till Joy has ( booted up ? 3.3seconds)
// then settles to a delay of 17.16ms
Serial.begin(38400, SERIAL_8E1);
digitalWrite (JSIGPIN, HIGH); // Power button pressed On (from off state)
delay(293);
digitalWrite (JSIGPIN, LOW);
delay(10);
// Fist packet of data sent from Joystick
Serial.write((0x74), (0x82), (0x85), (0x82), (0x80), (0x88), (0xCD), (0xA0), (0x80), (0x8D), (0x0F));
delay(1);
Serial.write((0x05), (0x80), (0xFA));
delay(1);
Serial.write(0x0F);
// delay till next group of data
delay(1);
// Second group of data
// Appears to be Joystick raw data reads/reads after interpretation by Wizard Software settings
Serial.write((0x60), (0xC0), (0xBF), (0xFF), (0xCD), (0x80), (0x8C), (0x80), (0xC8), (0x0F));
delay(2);
// Third group of data
// Inhibit files ? till joystick has booted up fully ?
// All inhibit bytes start with (0x61) and stop after 3.3seconds
Serial.write((0x61), (0x80), (0x80), (0xC0), (0x80), (0x80), (0x80), (0x80), (0xDE));
delay(0)
// End bits are (0x0F)
Serial.write(0x0F)
// now a cycle of Joystick (0x060), inhibit/raw/controller values (0x61) continues till 3.3seconds
// Then a steady stream of Joystick data with 17.16ms delay between bytes of data.
// Start bit, 8 data bits, End Bit
// Start bit " ' "(0x60) Address ?
// Bit 1 "192"(0xC0) Y axis data
// Bit 2 "192"(0xC0) X axis data
// Bit 3 "255"(0xFF) Speed max setting
// Bit 4 "192"(0xC0) Speed fine tune ?
// Bit 5 "128"(0x80) Horn off/ 130on
// Bit 6 "140"(0x8C) Joystick on ?
// Bit 7 "128"(0x80) Chair mode (128drive/129tilt)
// Bit 8 "212"(0xD4) Some other XY modifier ?
// End Bit "15"(0x0F) End packet
// is 3.2 seconds of data packets necessary ?
// would not a "if bit 1 <>='192'(0xC0)" then inhibit enable ? suffice
}
pinMode(pwrBtn, INPUT_PULLUP);
pinMode(LEDPIN, OUTPUT);
pinMode(INHPIN, OUTPUT);
void loop() {
//read the value from the Y axis on port A0
YpinValue = analogRead(Ypin);
//read the value from the X axis on Port A1
XpinValue = analogRead(Xpin);
///build serial packet
data[0]= (0x60); // Joystick packets start with this " ' " not accepted had to use hex
data[1]= YpinValue; // Joystick Y value
data[2]= XpinValue; // Joystick X value
data[3]= 255; // Max speed setting via turtle/hare buttons on joystick
data[4]= 192; // Speed Fine Tune ?
data[5]= 128; // default horn off, horn on value is 130
data[6]= 140; // joystick On Value ?
data[7]= 128; // chair mode/ drive 128, tilt/aux output 129
data[8]= 212; // some other XY modifier..maybe acceleration/de settings
data[9]= 15; // all packets end with this identifier
data[10]=0xff-(data[0]+data[1]+data[2]+data[3]+data[4]); //-Check sum
for(unsigned char i=0;i<11;i++);
Serial.write(data[i]);
//
}
// This sketch is to emulate the packet of data that the Shark Joystick sends
/******************************************************************************
* Author: Tony Matthews ammatthews at gmail dot com
* License: FreeBSD
******************************************************************************/
/******************************************************************************
Copyright (c) 2015, Tony Matthews
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*******************************************************************************/
// This code is incomplete and still under revision.
// Its also got junk that may not be needed,
// Early testing phases.
// Successful output of Data packet for Shark Wheelchair controller.
// Not tested on chair, just on the Logic Analyzer.
// Pulse at one second for testing, chair sends pulse every 17ish microseconds
#include <SoftwareSerial.h>
#define rxPin 10 // Digital Pin10 for Receive from controller.
// this will have to be changed for the GCDuiNode as it uses this pin to communicate with the RF24
#define txPin 11 // Digital Pin11 Transmit from Shark Joystick to Controller.
// int sharkDataInt [10]; //Declare size of data packet sent from Shark Joystick
int joyStartByte; // was/is to setup/call function from new "void sharkJoyInt" .h file yet to be written.
// Names for Pins and what they are connected to
const int yPot = A0; // Y Pot input value
const int xPot = A1; // X Pot input value
// not used yet but will be one day...not that i ever dial my chair down...what's the point of going slow :P
int maxPot = A2; // Max speed dial pot
// Names for analogRead values of Analog Pots
int yPotVal;
int xPotVal;
int maxSpeedVal;
// Names for Mapped analogRead Values of Pots
int yPotValMapped;
int xPotValMapped;
// Size of data packet, tho the packets are not constrained to this size.
// This size for this packet but probably not for others.
unsigned char data[10];
unsigned long timer = 0;
// set up a new serial port
SoftwareSerial sharkSerial (rxPin, txPin, true); // TRUE sets this to invert software serial output.
void setup() {
// define pin modes for tx, rx:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// set the data rate for the SoftwareSerial port
sharkSerial.begin(38400);
}
void loop() {
// the brackets above and below are for the packet of data
// below is the packet of data i would like to test there are notes next to what the
// current thinking is as to the function of each piece of data
// Logic4 Async serial inverted logic sniffer is attached to pins
// RX and TX on Arduino Nano V3.0
{
yPotVal = analogRead(yPot);
xPotVal = analogRead(xPot);
yPotValMapped = map(yPotVal, 0, 1023, 128, 255); // Map min/max pot values to match min/max original Shark joystick values.
xPotValMapped = map(xPotVal, 0, 1012, 128, 255); // Map X values
}
{
//build serial packet
data[0] = (0x60); // Joystik packets start with this " ' " not accepted had to use hex
data[1] = yPotValMapped; // Joystick Y value
data[2] = xPotValMapped; // Joystick X value
data[3] = 255; // Max speed setting via turtle/hare buttons on joystick
data[4] = 192; // Speed Fine Tune ?
data[5] = 128; // default horn off, horn on value is 130
data[6] = 140; // joystick On Value ?
data[7] = 128; // chair mode/ drive 128, tilt/aux output 129
data[8] = 212; // some other XY modifier..maybe acceleration/de settings
data[9] = 15; // all packets end with this identifier
for (unsigned char i = 0; i < 10; i++)
{
sharkSerial.write(data[i]);
}
}
delayMicroseconds(1716); //Delay next packet 17ms input from Shark joystick
}



QLogic is crap, everyone that has one knows its's over controlled.
gcebiker wrote:Thread for Qlogic is here viewtopic.php?f=2&t=2757 , also known as Curtis Controller OEM programmer.
I have the parts to do as Woody has posted on page 2 of the thread.
I've the software....
I can try it out, but it will mean.
Rewire of the chair i am sitting in... I'm not so keen on that.
Meh , i ll just use the Ezyrider to get to the toilet.
But winners are grinners and it its grand final weekend
Sunday is rewire day, if all goes well i will bring a laptop Tuesday...you will need time to get used to the chair responding correctly after so many years with it.
Ill back up old program first (if i get it sorted on Sunday).
Shit while i am at it , i may as well see if i can fit the reclining race seat i have in the shed to the Power Base.
damit, its midnight, im drunk and posting again when i should be coding.
Drunk + Coding actually works out pretty well it turns out....just read all the 'coherent' posts above
....Brain Damage is freakin weird. 11 Years this year, I'm still not used to it.
You seem to be under the impression that using the Arduino as an input rather than the joystick will override / take out the delays etc ... well it depends where the programming of delays etc resides.






Return to Everything Powerchair
Users browsing this forum: Burgerman, Jeffulike, Juggler258, yeshelp and 90 guests