void setup(){
pinMode(2,INPUT);
}
void loop () {
}
void setup(){
pinMode(2,INPUT_PULLUP);
}
void loop () {
}
I had the same question building my first custom board. If you have a PCB, definitely go with PCB mount switches. If you don't have a PCB, you can really choose either and it won't make a difference. PCB mounted switches just have extra nubs for creating a firm connection with the PCB.
I had the same question building my first custom board. If you have a PCB, definitely go with PCB mount switches. If you don't have a PCB, you can really choose either and it won't make a difference. PCB mounted switches just have extra nubs for creating a firm connection with the PCB.
Okay just found something I can't figure out on my own. I found two kinds of cherry switches. One is called plate mount, and the other is called PCB mount.
Which one do you think I should get?
http://www.wasdkeyboards.com/index.php/products/keyboard-parts/cherry-mx-red-keyswitch-mx1a-l1nw-linear.html
http://www.wasdkeyboards.com/index.php/products/keyboard-parts/cherry-mx-red-keyswitch-mx1a-l1nn-linear.html
So, in the next few weeks I hope to mold an initial design from sculptors Clay and try sticking the keys onto it to get a basic working design for ergonomics and physical functioning.
I have just now ordered a lump of clay from Amazon, and it should arrive middle of next week. Perhaps if I can get the basic design together, [...]
Small update.
Found a guy in Finland who has agreed to build this part for me for 50 bucks.
http://xim4.com/community/index.php?topic=31390.0
Just like https://oshpark.com/shared_projects/2p7rQYx8 would be enough.Small update.
Found a guy in Finland who has agreed to build this part for me for 50 bucks.
http://xim4.com/community/index.php?topic=31390.0
Wait. $50 for a connector with 4 wires? Lordy me
I know from experience. I used to play with Xbox controller in left hand and Logitech M570 in right hand. LoL is much better with a controller or an orbweaver or with what we are trying to build. ESPECIALLY because you get true camera control /w thumb. Not that laborious thing of pulling your pointer away from the action to the edge of the screen and ‘bumping’ it outward. Rather, in case you haven’t somehow played in this way, let me tell you, you get an elegant continual feathering of fine camera control – positioning the camera to a tactically optimal position at all times – an activity which is INDEPENDENT of all other commands. Its wonderful although i have not managed to convince any of my LoL friends of this or anyone else in the community for that matter.
So you basically controlled the cam with the left hand using a stick while at the same time aiming attacks with the mouse on the right? Does this work out of the box? I thought both inputs would be registered equally by the computer, making them overlap and not work this way?
So you basically controlled the cam with the left hand using a stick while at the same time aiming attacks with the mouse on the right? Does this work out of the box? I thought both inputs would be registered equally by the computer, making them overlap and not work this way?
3K,
I think i know what you mean about the overlapping. But in practice, it brings about something wonderful. Yes, when using arrow keys or a joystick to move the map, the pointer comes along for the ride. It does not get left behind in its position, but rather remains in its relative position on screen. You can therefore place the pointer onto anything by only using camera control if you really wanted to. Try it. And yes, it is out of the box /w camera unlocked as anyone other than a 1st time player would choose.
Why is this helpful? Something outstanding happens with the combo of joystick and mouse, which is a combination very similar to WASD and mouse control in an FPS. One movement is the macro or large imprecise movement control while the other movement allows for the finer control.
With this combo and league, you end up using the camera control continuously, which also moves the mouse pointer in an imprecise but non-laborious way, while making quick, purposeful, precise pointing commands with the mouse. The result is that you move the mouse pointer vastly less often and with much less travel distance than the conventional way of using the mouse without assisting its movement with any complementary movement. Another way to state this would be that you not only have continuous independent direct camera control, you also get a significant pointer control assist that takes something like 70% of the labor out of moving the mouse pointer because pointer control is essentially done with two hands instead of one.
The difference is night and day. How big of a difference? imagine playing an FPS without any WASD controls for walking, and you only had a mouse to control your reticule and could never strafe
It's quite hard to get my head round how to actually make this, it's not even like you can make strips of switches for each position and stick them together as all the fingers are different sizes. I think clay is a great choice as it doesn't harden anywhere near as quickly as the plastic and hot glue I'll be using, and you're very unlikely to burn yourself while I'd rate my chances 50/50 at best!
So you basically controlled the cam with the left hand using a stick while at the same time aiming attacks with the mouse on the right? Does this work out of the box? I thought both inputs would be registered equally by the computer, making them overlap and not work this way?
3K,
I think i know what you mean about the overlapping. But in practice, it brings about something wonderful. Yes, when using arrow keys or a joystick to move the map, the pointer comes along for the ride. It does not get left behind in its position, but rather remains in its relative position on screen. You can therefore place the pointer onto anything by only using camera control if you really wanted to. Try it. And yes, it is out of the box /w camera unlocked as anyone other than a 1st time player would choose.
Why is this helpful? Something outstanding happens with the combo of joystick and mouse, which is a combination very similar to WASD and mouse control in an FPS. One movement is the macro or large imprecise movement control while the other movement allows for the finer control.
With this combo and league, you end up using the camera control continuously, which also moves the mouse pointer in an imprecise but non-laborious way, while making quick, purposeful, precise pointing commands with the mouse. The result is that you move the mouse pointer vastly less often and with much less travel distance than the conventional way of using the mouse without assisting its movement with any complementary movement. Another way to state this would be that you not only have continuous independent direct camera control, you also get a significant pointer control assist that takes something like 70% of the labor out of moving the mouse pointer because pointer control is essentially done with two hands instead of one.
The difference is night and day. How big of a difference? imagine playing an FPS without any WASD controls for walking, and you only had a mouse to control your reticule and could never strafe
This sounds really good and I would love to test this out! Unfortunately I do not own any device with joystick that works on my computer right now. I'll look into connecting my wireless XBOX360 controller.
I guess this is a strong argument for not missing out on a joystick on the device this thread one day will publish!
It would also suck to burn yourself with hot glue xD
Looking good, I can see how it's all going to fit together now. If it's comfy and it works who cares how it looks :thumb:
If you're hoping to replace all that pinkish stuff with Sugru you're going to need a lot more than one pack though, unless there's a lot of solid stuff hiding in there. Also don't forget you need to get some wires to the switches!
This is coming together nicely, glad to hear the sugru is working out :)
behold... blinking lights ;D
(Attachment Link)
void setup() {
Keyboard.begin();
}
void loop() {
Keyboard.press('n');
delay(100);
Keyboard.releaseAll();
delay(10000);
}
I've been thinking about this and how close it is to being able to use two as a full keyboard, so why not add another switch per finger?Show Image(http://i.imgur.com/KEYFBhC.png)
In place of the joystick I'm thinking three switches per thumb which still only takes the keycount to 38, but adding two imaginary 5th fingers (operated by the index fingers being raised toward the thumb) would make 46, which is more than a JD40...
void setup(){
pinMode(2,INPUT_PULLUP);
}
void loop () {
}
You've gone beyond my knowledge of windows and gaming controllers, but is this (http://www.instructables.com/id/Add-USB-Game-Controller-to-Arduino-LeonardoMicro/) how you want it to show up?
boolean oState = HIGH;
boolean buttonState = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
buttonState = digitalRead(2); //read physical button 2
if(buttonState != oState) { //check against previous button state, if changed do something
if(buttonState == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState = buttonState; //save state to compare next time
}
}
I don't have an Arduino handy but think this should work for one button, it compiles ok...Code: [Select]boolean oState = HIGH;
boolean buttonState = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
buttonState = digitalRead(2); //read physical button 2
if(buttonState != oState) { //check against previous button state, if changed do something
if(buttonState == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState = buttonState; //save state to compare next time
}
}
From reading the example sketch I have no idea how they connected their many buttons...
Thin wire, and lots of it? You could get some on amazon (http://www.amazon.com/NTE-Stranded-AWG-Hook-Up-Wire/dp/B005S3MMU0%3FSubscriptionId%3DAKIAILSHYYTFIVPWUY6Q%26tag%3Dduc08-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB005S3MMU0) (random example, may be available cheaper/in a more appropriate quantity) or if you have any Cat 5e Ethernet cables lying around at home/work/school they contain 8 strands of 24AWG.
I don't have an Arduino handy but think this should work for one button, it compiles ok...Code: [Select]boolean oState = HIGH;
boolean buttonState = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
buttonState = digitalRead(2); //read physical button 2
if(buttonState != oState) { //check against previous button state, if changed do something
if(buttonState == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState = buttonState; //save state to compare next time
}
}
From reading the example sketch I have no idea how they connected their many buttons...
Thin wire, and lots of it? You could get some on amazon (http://www.amazon.com/NTE-Stranded-AWG-Hook-Up-Wire/dp/B005S3MMU0%3FSubscriptionId%3DAKIAILSHYYTFIVPWUY6Q%26tag%3Dduc08-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB005S3MMU0) (random example, may be available cheaper/in a more appropriate quantity) or if you have any Cat 5e Ethernet cables lying around at home/work/school they contain 8 strands of 24AWG.
boolean oState = HIGH;
boolean buttonState2 = HIGH;
boolean buttonState3 = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
buttonState2 = digitalRead(2); //read physical button 2
buttonState3 = digitalRead(3); //read physical button 3
if(buttonState2 != oState) { //check against previous button state, if changed do something
if(buttonState2 == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState = buttonState2; //save state to compare next time
}
if(buttonState3 != oState) { //check against previous button state, if changed do something
if(buttonState3 == LOW) { //button has been pressed
Joystick.pressButton(1); //press "joystick" button 2
}
else { //button has been released
Joystick.releaseButton(1); //release "joystick" button 2
}
oState = buttonState3; //save state to compare next time
}
}
boolean oState2 = HIGH;
boolean oState3 = HIGH;
boolean buttonState2 = HIGH;
boolean buttonState3 = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
buttonState2 = digitalRead(2); //read physical button 2
buttonState3 = digitalRead(3); //read physical button 3
if(buttonState2 != oState2) { //check against previous button state, if changed do something
if(buttonState2 == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState2 = buttonState2; //save state to compare next time
}
if(buttonState3 != oState3) { //check against previous button state, if changed do something
if(buttonState3 == LOW) { //button has been pressed
Joystick.pressButton(1); //press "joystick" button 2
}
else { //button has been released
Joystick.releaseButton(1); //release "joystick" button 2
}
oState3 = buttonState3; //save state to compare next time
}
}
i checked kynar wire and found that it's solid core. i like the thin size, but won't this wire break after being moved around a lot? it looks like it's only good for internal applicationsYes, you only bend it once (or twice, but no more than that). And mostly only for internal applications.
Nice, you have gotten this far :)
I will tell few things from my experience regarding joysticks.
...
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 256
int Xstick;
int Ystick;
void setup() {
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, 0, 1024);
Xstick = constrain(Xstick, 0 , 1023);
Joystick.X(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 1024, 0);
Ystick = constrain(Ystick, 0 , 1023);
Joystick.Y(Ystick);
Joystick.button(1, !digitalRead(0));
Joystick.button(2, !digitalRead(1));
}
Arduino: 1.6.5 (Windows 7), Board: "Arduino Leonardo"
vita_stick_1.ino: In function 'void loop()':
vita_stick_1:19: error: 'class Joystick_' has no member named 'X'
vita_stick_1:22: error: 'class Joystick_' has no member named 'Y'
vita_stick_1:24: error: 'class Joystick_' has no member named 'button'
vita_stick_1:25: error: 'class Joystick_' has no member named 'button'
'class Joystick_' has no member named 'X'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
#define STICK_X 0
#define STICK_Y 1
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
boolean oState2 = HIGH;
boolean oState3 = HIGH;
boolean buttonState2 = HIGH;
boolean buttonState3 = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
buttonState2 = digitalRead(2); //read physical button 2
buttonState3 = digitalRead(3); //read physical button 3
if(buttonState2 != oState2) { //check against previous button state, if changed do something
if(buttonState2 == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState2 = buttonState2; //save state to compare next time
}
if(buttonState3 != oState3) { //check against previous button state, if changed do something
if(buttonState3 == LOW) { //button has been pressed
Joystick.pressButton(1); //press "joystick" button 2
}
else { //button has been released
Joystick.releaseButton(1); //release "joystick" button 2
}
oState3 = buttonState3; //save state to compare next time
}
}
Welcome to the party W11cE, sounds like you bring some much needed experience with this stuff :)Thanks, I though you already have more experienced people on this forum?
Just to clarify you meant to say it's better to use "INPUT_PULLDOWN" so the Teensy has less live pins causing less interference? Makes sense...
By default the Joystick does update on button press but there's an option to do it manually. As you say, one for later!
Thanks, I though you already have more experienced people on this forum?
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
boolean oState2 = HIGH;
boolean oState3 = HIGH;
boolean buttonState2 = HIGH;
boolean buttonState3 = HIGH;
void setup() {
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
Joystick.begin();
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
buttonState2 = digitalRead(2); //read physical button 2
buttonState3 = digitalRead(3); //read physical button 3
if(buttonState2 != oState2) { //check against previous button state, if changed do something
if(buttonState2 == LOW) { //button has been pressed
Joystick.pressButton(0); //press "joystick" button 1
}
else { //button has been released
Joystick.releaseButton(0); //release "joystick" button 1
}
oState2 = buttonState2; //save state to compare next time
}
if(buttonState3 != oState3) { //check against previous button state, if changed do something
if(buttonState3 == LOW) { //button has been pressed
Joystick.pressButton(1); //press "joystick" button 2
}
else { //button has been released
Joystick.releaseButton(1); //release "joystick" button 2
}
oState3 = buttonState3; //save state to compare next time
}
}
I'm really liking this thread so far! Great work and a really unique design, I think I have found a project for next year.
I'm interested to see how it will all turn out
If I'm understanding this right all the actual commands the buttons do will be configured in xpadder, so you just need to update the button statuses?
Pretty sure that means you just need 13 pins (one per switch) setup with an "on change" interrupt, with the main thread running the analog stick. If you can run an interrupt routine including the pin that triggered it this code might be even smaller than the two button example above!
This thread is totally AWESOME
My experiences were very similar to what you're writing about. Later I tried transferring this to digital and 3d printing, but as it turned out, the slight changes in key positioning were really crucial! The feel of the 3d print was really different.
I'm now trying to get my head round whether a 3x5 matrix could work where you cycle between the 3 and use the 5 on the interrupt pins. Would it need diodes? Can you switch what each interrupt does and keep track of all the statuses any quicker than just scanning? Also you have your keys in blocks of 4 so perhaps a 4x4 would work better with wiring in mind, though that would make it slower. Maybe 4x3 plus an odd one?
Think I need to get my breadboard out and have a play :))
Yes, and it is done much better. It has native mouse + kb + joystick mode. No need to install anything extra except teensyduino.
Here is basic joystick usage: http://pjrc.com/teensy/td_joystick.html
That is a little outdated, but main features are there.
If you want to go with a smaller microcontroller, i recommend teensy 3.2 or LC. More everything in a smaller package and cheaper, than in micro.
http://pjrc.com/teensy/teensy31.html
http://pjrc.com/teensy/teensyLC.html
Those are what I use in all of my mods.
same as before, does someone happen to know what the pinouts are for on this stick(1-4)? need to know the power, ground, x and y. i scoured the internet and couldn't find any mention of the pinouts.
Nice, looks like the hardware is nearly done - you should be back gaming by new year :)
I appreciate this kind of project as it is a it the opportunity to play to people with a single hand (or single usable hand).
The main differences between leonardo and teensy joystick code are a little different words used and analog stick range. On leonardo its from -127 to 128 and on teensy its from 0 to 1023.
Both are simple to change so no problems there.
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2)
if (Temp < -30) {
if buttonState[8] = 0{
buttonState[8] = 1
}
else
if buttonState[8] = 1{
buttonState[8] = 0
}
}
if (Temp > 30) {
if buttonState[9] = 0{
buttonState[9] = 1
}
else
if buttonState[9] = 1{
buttonState[9] = 0
}
}
Temp = analogRead(3)
if (Temp < -30) {
if buttonState[10] = 0{
buttonState[10] = 1
}
else
if buttonState[10] = 1{
buttonState[10] = 0
}
}
if (Temp > 30) {
if buttonState[11] = 0{
buttonState[11] = 1
}
else
if buttonState[11] = 1{
buttonState[11] = 0
}
}
Temp = analogRead(4)
if (Temp < -30) {
if buttonState[12] = 0{
buttonState[12] = 1
}
else
if buttonState[12] = 1{
buttonState[12] = 0
}
}
if (Temp > 30) {
if buttonState[13] = 0{
buttonState[13] = 1
}
else
if buttonState[13] = 1{
buttonState[13] = 0
}
}
Temp = analogRead(4)
if (Temp < -30) {
if buttonState[14] = 0{
buttonState[14] = 1
}
else
if buttonState[14] = 1{
buttonState[14] = 0
}
}
if (Temp > 30) {
if buttonState[15] = 0{
buttonState[15] = 1
}
else
if buttonState[15] = 1{
buttonState[15] = 0
}
}
Joystick.sendState()
}
I've made progress, but what do you want the second analog to be controlling? I can only see X Y and Z axis, plus X Y and Z rotation axis.
Do both the other analogs need to be digitized?
No arduino here but I think this should work, I've digitised the analogs on pins 2-5 leaving 0 and 1 as the real analog as before.
Whether it's laggy remains to be seen...
Do you find the buttons comfortable to press?
I always had this issue with such handheld designs, that because the fingers essentially rested on the switches all the time, there were problems with grabbing it firmly, and it tended to change position inside of my hand with use. Had to be adjusted often as a result.
Always tried to get such designs strapped to the hand because of that.
('such designs' were mostly keyers in my case, I did a few prototypes).
('such designs' were mostly keyers in my case, I did a few prototypes).
This is very cool, really nice work so far. I love to see people using the keyboard-building knowledge from the community to build non-keyboard things, awesome project.
No arduino here but I think this should work, I've digitised the analogs on pins 2-5 leaving 0 and 1 as the real analog as before.
Whether it's laggy remains to be seen...
Arduino: 1.6.5 (Windows 7), Board: "Arduino Leonardo"
sketch_dec06a.ino: In function 'void loop()':
sketch_dec06a:47: error: expected ';' before 'if'
sketch_dec06a:131: error: expected '}' at end of input
sketch_dec06a:131: error: expected '}' at end of input
expected ';' before 'if'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
No arduino here but I think this should work, I've digitised the analogs on pins 2-5 leaving 0 and 1 as the real analog as before.
Whether it's laggy remains to be seen...
Unfortunately, this doesn't compile in Arduino IDE
This is the error message I gotCode: [Select]Arduino: 1.6.5 (Windows 7), Board: "Arduino Leonardo"
sketch_dec06a.ino: In function 'void loop()':
sketch_dec06a:47: error: expected ';' before 'if'
sketch_dec06a:131: error: expected '}' at end of input
sketch_dec06a:131: error: expected '}' at end of input
expected ';' before 'if'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Maybe it only works on the teensy after I install teensyduino?
forgot to ask, what's a keyer?
glad you like it. i'm certainly grateful for this community. what surprises me is how this community's work differs so much from mass consumption commercial products. maybe that won't be such a difference in a few more years when more people realize how much time they spend at pc and therefore how important the quality of tools are.
I could be wrong, but those just look like formatting errors, not actual problems with the code like variables not existing or something.
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2)
if (Temp < -30) {
if (buttonState[8] == 0){
buttonState[8] = 1;
}
else
if (buttonState[8] == 1){
buttonState[8] = 0;
}
}
if (Temp > 30) {
if (buttonState[9] == 0){
buttonState[9] = 1;
}
else
if (buttonState[9] == 1){
buttonState[9] = 0;
}
}
Temp = analogRead(3)
if (Temp < -30) {
if (buttonState[10] == 0){
buttonState[10] = 1;
}
else
if (buttonState[10] == 1){
buttonState[10] = 0;
}
}
if (Temp > 30) {
if (buttonState[11] == 0){
buttonState[11] = 1;
}
else
if (buttonState[11] == 1){
buttonState[11] = 0;
}
}
Temp = analogRead(4)
if (Temp < -30) {
if (buttonState[12] == 0){
buttonState[12] = 1;
}
else
if (buttonState[12] == 1){
buttonState[12] = 0;
}
}
if (Temp > 30) {
if (buttonState[13] == 0){
buttonState[13] = 1;
}
else
if (buttonState[13] == 1){
buttonState[13] = 0;
}
}
Temp = analogRead(4)
if (Temp < -30) {
if (buttonState[14] == 0){
buttonState[14] = 1;
}
else
if (buttonState[14] == 1){
buttonState[14] = 0;
}
}
if (Temp > 30) {
if (buttonState[15] == 0){
buttonState[15] = 1;
}
else
if (buttonState[15] == 1){
buttonState[15] = 0;
}
}
Joystick.sendState()
}
Does this work? I really should install Arduino on here so I can test it myself :))
Does this work? I really should install Arduino on here so I can test it myself :))
Do not have Arduino IDE installed as I'm moving to C code with avr-gcc, but I can still see missing ";". Too lazy to install the IDE, sorry :p
Does this work? I really should install Arduino on here so I can test it myself :))
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2);
if (Temp < -30) {
if (buttonState[8] == 0){
buttonState[8] = 1;
}
else
if (buttonState[8] == 1){
buttonState[8] = 0;
}
}
if (Temp > 30) {
if (buttonState[9] == 0){
buttonState[9] = 1;
}
else
if (buttonState[9] == 1){
buttonState[9] = 0;
}
}
Temp = analogRead(3);
if (Temp < -30) {
if (buttonState[10] == 0){
buttonState[10] = 1;
}
else
if (buttonState[10] == 1){
buttonState[10] = 0;
}
}
if (Temp > 30) {
if (buttonState[11] == 0){
buttonState[11] = 1;
}
else
if (buttonState[11] == 1){
buttonState[11] = 0;
}
}
Temp = analogRead(4);
if (Temp < -30) {
if (buttonState[12] == 0){
buttonState[12] = 1;
}
else
if (buttonState[12] == 1){
buttonState[12] = 0;
}
}
if (Temp > 30) {
if (buttonState[13] == 0){
buttonState[13] = 1;
}
else
if (buttonState[13] == 1){
buttonState[13] = 0;
}
}
Temp = analogRead(4);
if (Temp < -30) {
if (buttonState[14] == 0){
buttonState[14] = 1;
}
else
if (buttonState[14] == 1){
buttonState[14] = 0;
}
}
if (Temp > 30) {
if (buttonState[15] == 0){
buttonState[15] = 1;
}
else
if (buttonState[15] == 1){
buttonState[15] = 0;
}
}
Joystick.sendState()
;}}
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2);
if (Temp < -30) {
buttonState[8] = 1;
}
else {
buttonState[8] = 0;
}
if (Temp > 30) {
buttonState[9] = 1;
}
else {
buttonState[9] = 0;
}
Temp = analogRead(3);
if (Temp < -30) {
buttonState[10] = 1;
}
else {
buttonState[10] = 0;
}
if (Temp > 30) {
buttonState[11] = 1;
}
else {
buttonState[11] = 0;
}
Temp = analogRead(4);
if (Temp < -30) {
buttonState[12] = 1;
}
else {
buttonState[12] = 0;
}
if (Temp > 30) {
buttonState[13] = 1;
}
else {
buttonState[13] = 0;
}
Temp = analogRead(5);
if (Temp < -30) {
buttonState[14] = 1;
}
else {
buttonState[14] = 0;
}
if (Temp > 30) {
buttonState[15] = 1;
}
else {
buttonState[15] = 0;
}
Joystick.sendState()
}}
Temp = analogRead(2);
if (Temp < -30) {
buttonState[8] = 1;
}
else {
buttonState[8] = 0;
}
if (Temp > 30) {
buttonState[9] = 1;
}
else {
buttonState[9] = 0;
}
Temp = analogRead(3);
if (Temp < -30) {
buttonState[10] = 1;
}
else {
buttonState[10] = 0;
}
if (Temp > 30) {
buttonState[11] = 1;
}
else {
buttonState[11] = 0;
}
Temp = analogRead(4);
if (Temp < -30) {
buttonState[12] = 1;
}
else {
buttonState[12] = 0;
}
if (Temp > 30) {
buttonState[13] = 1;
}
else {
buttonState[13] = 0;
}
Temp = analogRead(5);
if (Temp < -30) {
buttonState[14] = 1;
}
else {
buttonState[14] = 0;
}
if (Temp > 30) {
buttonState[15] = 1;
}
else {
buttonState[15] = 0;
}
Temp = analogRead(5);
if (Temp < -30) {
buttonState[14] = 1;
}
else {
buttonState[14] = 0;
}
// a piece of code that says if Temp is between something and something, button 15 should be activated
if (Temp > 30) {
buttonState[16] = 1;
}
else {
buttonState[16] = 0;
// a piece of code that says if Temp is between something and something, button 17 should be activated
}
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2);
if (Temp < -30) {
buttonState[8] = 1;
}
else {
buttonState[8] = 0;
}
if (Temp > 30) {
buttonState[9] = 1;
}
else {
buttonState[9] = 0;
}
Temp = analogRead(3);
if (Temp < -30) {
buttonState[10] = 1;
}
else {
buttonState[10] = 0;
}
if (Temp > 30) {
buttonState[11] = 1;
}
else {
buttonState[11] = 0;
}
Temp = analogRead(4);
if (Temp < -30) {
buttonState[12] = 1;
}
else {
buttonState[12] = 0;
}
if (Temp > 30) {
buttonState[13] = 1;
}
else {
buttonState[13] = 0;
}
Temp = analogRead(5);
if (Temp < -30) {
buttonState[14] = 1;
}
else {
buttonState[14] = 0;
}
if (Temp > 30) {
buttonState[15] = 1;
}
else {
buttonState[15] = 0;
}
Joystick.sendState()
;}}
It shouldn't be doing analog at all though, just buttons :confused:
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Temp = analogRead(2);
if (Temp < -30) {
buttonState[8] = 1;
}
else {
buttonState[8] = 0;
}
if (Temp > 30) {
buttonState[9] = 1;
}
else {
buttonState[9] = 0;
}
Temp = analogRead(3);
if (Temp < -30) {
buttonState[10] = 1;
}
else {
buttonState[10] = 0;
}
if (Temp > 30) {
buttonState[11] = 1;
}
else {
buttonState[11] = 0;
}
Temp = analogRead(4);
if (Temp < -30) {
buttonState[12] = 1;
}
else {
buttonState[12] = 0;
}
if (Temp > 30) {
buttonState[13] = 1;
}
else {
buttonState[13] = 0;
}
Temp = analogRead(5);
if (Temp < -30) {
buttonState[14] = 1;
}
else {
buttonState[14] = 0;
}
if (Temp > 30) {
buttonState[15] = 1;
}
else {
buttonState[15] = 0;
}
Joystick.sendState()
;}}
I have no analog stick at home but I can take a deeper look into the code if you want.
I have no analog stick at home but I can take a deeper look into the code if you want.
Please do - it's pretty simple and I've outlined above what it's supposed to do but not only is it not pressing the buttons as requested it's moving the analog, and not even doing that well. Either I've missed something major or there's a hardware issue, but with nothing here to "poke and see what happens" it's hard to tell which!
#define STICK_X A0
#define STICK_Y A1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, -127, 127);
Xstick = constrain(Xstick, -127, 127);
Joystick.setXAxis(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 127, -127);
Ystick = constrain(Ystick, -127, 127);
Joystick.setYAxis(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
if(buttonState[i] == LOW) // button has been pressed
{
Joystick.pressButton(i); // press corresponding "joystick" button
}
else // button has been released
{
Joystick.releaseButton(i); // release corresponding "joystick" button
}
oState[i] = buttonState[i]; // save state to compare next time
}
Temp = analogRead(A2);
(Temp < -30) ? buttonState[8] = 1 : buttonState[8] = 0;
(Temp > 30) ? buttonState[9] = 1 : buttonState[9] = 0;
Temp = analogRead(A3);
(Temp < -30) ? buttonState[10] = 1 : buttonState[10] = 0;
(Temp > 30) ? buttonState[11] = 1 : buttonState[11] = 0;
Temp = analogRead(A4);
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Temp = analogRead(A5);
(Temp < -30) ? buttonState[14] = 1 : buttonState[14] = 0;
(Temp > 30) ? buttonState[15] = 1 : buttonState[15] = 0;
// Update joystick state
Joystick.sendState();
}
}
Arduino: 1.6.6 (Windows 7), Board: "Arduino Leonardo"
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBAPI.h:38:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:19:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:54:71: error: 'USB_EP_SIZE' was not declared in this scope
D_ENDPOINT(USB_ENDPOINT_OUT(CDC_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,USB_EP_SIZE,0),
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.h:272:22: note: in definition of macro 'D_ENDPOINT'
{ 7, 5, _addr,_attr,_packetSize, _interval }
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:55:71: error: 'USB_EP_SIZE' was not declared in this scope
D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,USB_EP_SIZE,0)
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.h:272:22: note: in definition of macro 'D_ENDPOINT'
{ 7, 5, _addr,_attr,_packetSize, _interval }
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:64:16: error: 'bool CDC_Setup' redeclared as different kind of symbol
bool CDC_Setup(USBSetup& setup)
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:19:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBAPI.h:269:6: error: previous declaration of 'bool CDC_Setup(Setup&)'
bool CDC_Setup(Setup& setup);
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp:64:16: error: 'USBSetup' was not declared in this scope
bool CDC_Setup(USBSetup& setup)
^
exit status 1
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
i had a thought. maybe the 2nd analog stick only works if the 1st analog stick remains connected. i haven't tried connecting both existing sticks yet.
Not surprising you're getting the same results as the code is the same just much tidier (thanks GuilleAcousitc - I'll remember that structure!)
Regarding the serial output, could you send me the code ?
#define STICK_X A0
#define STICK_Y A1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, -127, 127);
Xstick = constrain(Xstick, -127, 127);
Joystick.setXAxis(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 127, -127);
Ystick = constrain(Ystick, -127, 127);
Joystick.setYAxis(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
if(buttonState[i] == LOW) // button has been pressed
{
Joystick.pressButton(i); // press corresponding "joystick" button
}
else // button has been released
{
Joystick.releaseButton(i); // release corresponding "joystick" button
}
oState[i] = buttonState[i]; // save state to compare next time
}
Temp = analogRead(A2);
(Temp < -30) ? buttonState[8] = 1 : buttonState[8] = 0;
(Temp > 30) ? buttonState[9] = 1 : buttonState[9] = 0;
Temp = analogRead(A3);
(Temp < -30) ? buttonState[10] = 1 : buttonState[10] = 0;
(Temp > 30) ? buttonState[11] = 1 : buttonState[11] = 0;
Temp = analogRead(A4);
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Temp = analogRead(A5);
(Temp < -30) ? buttonState[14] = 1 : buttonState[14] = 0;
(Temp > 30) ? buttonState[15] = 1 : buttonState[15] = 0;
// Update joystick state
Joystick.sendState();
}
}
Arduino: 1.6.5 (Windows 7), TD: 1.26, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz optimized (overclock), US English"
Build options changed, rebuilding all
sketch_dec09a.ino: In function 'void setup()':
sketch_dec09a:20: error: no matching function for call to 'usb_joystick_class::begin(bool)'
sketch_dec09a.ino:20:23: note: candidate is:
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:28:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:1,
from sketch_dec09a.ino:5:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_joystick.h:55:14: note: void usb_joystick_class::begin()
void begin(void) { }
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_joystick.h:55:14: note: candidate expects 0 arguments, 1 provided
sketch_dec09a.ino: In function 'void loop()':
sketch_dec09a:28: error: 'class usb_joystick_class' has no member named 'setXAxis'
sketch_dec09a:33: error: 'class usb_joystick_class' has no member named 'setYAxis'
sketch_dec09a:43: error: 'class usb_joystick_class' has no member named 'pressButton'
sketch_dec09a:47: error: 'class usb_joystick_class' has no member named 'releaseButton'
sketch_dec09a:69: error: 'class usb_joystick_class' has no member named 'sendState'
'class usb_joystick_class' has no member named 'sendState'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Have you tried running the Arduino program as administrator? Perhaps you don't have permission to access serial ports. Also have you set the USB type under tools? Don't think that was there with an Arduino but it is for Teensy, having changed that the code compiled! Then I had to select a port (also under tools) so check that looks right. I can't believe you have two defective boards, that would be so unlucky!
Arduino: 1.6.5 (Windows 7), TD: 1.26, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz optimized (overclock), US English"
Sketch uses 18,664 bytes (7%) of program storage space. Maximum is 262,144 bytes.
Global variables use 6,480 bytes (9%) of dynamic memory, leaving 59,056 bytes for local variables. Maximum is 65,536 bytes.
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
no serial port name defined
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
USB 3.0 on PC1
USB 2.0 on PC2
could explain the properties blank i got on PC1 when choosing keyboard/mouse/joystick without serial
#define STICK_X 2
#define STICK_Y 3
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0,1,2,3,4,5,6,7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup() {
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
int i;
for (i = 0; i < 8; i = i + 1) {
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop() {
Xstick = map(analogRead(STICK_X), OVERVAL, 1024-OVERVAL, -127, 128);
Xstick = constrain(Xstick, -127 , 128);
Joystick.setXAxis(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024-OVERVAL, 128, -127);
Ystick = constrain(Ystick, -127 , 128);
Joystick.setYAxis(Ystick);
int i;
for (i = 0; i < 8; i = i + 1) {
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) { //check against previous button state, if changed do something
if(buttonState[i] == LOW) { //button has been pressed
Joystick.pressButton(i); //press corresponding "joystick" button
}
else { //button has been released
Joystick.releaseButton(i); //release corresponding "joystick" button
}
oState[i] = buttonState[i]; //save state to compare next time
}
Joystick.sendState()
;}}
#define STICK_X A0
#define STICK_Y A1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
Joystick.begin(false);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, -127, 127);
Xstick = constrain(Xstick, -127, 127);
Joystick.setXAxis(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 127, -127);
Ystick = constrain(Ystick, -127, 127);
Joystick.setYAxis(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
if(buttonState[i] == LOW) // button has been pressed
{
Joystick.pressButton(i); // press corresponding "joystick" button
}
else // button has been released
{
Joystick.releaseButton(i); // release corresponding "joystick" button
}
oState[i] = buttonState[i]; // save state to compare next time
}
Temp = analogRead(A2);
(Temp < -30) ? buttonState[8] = 1 : buttonState[8] = 0;
(Temp > 30) ? buttonState[9] = 1 : buttonState[9] = 0;
Temp = analogRead(A3);
(Temp < -30) ? buttonState[10] = 1 : buttonState[10] = 0;
(Temp > 30) ? buttonState[11] = 1 : buttonState[11] = 0;
Temp = analogRead(A4);
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Temp = analogRead(A5);
(Temp < -30) ? buttonState[14] = 1 : buttonState[14] = 0;
(Temp > 30) ? buttonState[15] = 1 : buttonState[15] = 0;
// Update joystick state
Joystick.sendState();
}
}
I've read here and there people havibg issues with peripherals on Usb3...
"no serial port name defined" is what I get when there's nothing set in tools -> port. There's only one entry in the list so you'd think it would default to that but it doesn't.
would someone mind adding a serial print thing to the sketch? i can only take away or change things in a sketch that's more than about 2 lines :rolleyes:
#define STICK_X A0
#define STICK_Y A1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
Serial.begin(9600);
Serial.println("Joystick ready");
Joystick.begin(false);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, -127, 127);
Xstick = constrain(Xstick, -127, 127);
Joystick.setXAxis(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 127, -127);
Ystick = constrain(Ystick, -127, 127);
Joystick.setYAxis(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
if(buttonState[i] == LOW) // button has been pressed
{
Joystick.pressButton(i); // press corresponding "joystick" button
}
else // button has been released
{
Joystick.releaseButton(i); // release corresponding "joystick" button
}
oState[i] = buttonState[i]; // save state to compare next time
}
Temp = analogRead(A2);
Serial.println(Temp)
(Temp < -30) ? buttonState[8] = 1 : buttonState[8] = 0;
(Temp > 30) ? buttonState[9] = 1 : buttonState[9] = 0;
Temp = analogRead(A3);
(Temp < -30) ? buttonState[10] = 1 : buttonState[10] = 0;
(Temp > 30) ? buttonState[11] = 1 : buttonState[11] = 0;
Temp = analogRead(A4);
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Temp = analogRead(A5);
(Temp < -30) ? buttonState[14] = 1 : buttonState[14] = 0;
(Temp > 30) ? buttonState[15] = 1 : buttonState[15] = 0;
// Update joystick state
Joystick.sendState();
}
}
// Includes
#include <stdio.h> // In order to use the sprintf() function
// Joysticks pinout
const int _JOY1_XAXIS = A0;
const int _JOY1_YAXIS = A1;
const int _JOY2_XAXIS = A2;
const int _JOY2_YAXIS = A3;
const int _JOY3_XAXIS = A4;
const int _JOY3_YAXIS = A5;
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop()
{
// Joystick 1
int joy1_xvalue = map(analogRead(_JOY1_XAXIS), 0, 1023, -127, 127);
int joy1_yvalue = map(analogRead(_JOY1_YAXIS), 0, 1023, 127, -127);
// Joystick 2
int joy2_xvalue = map(analogRead(_JOY2_XAXIS), 0, 1023, -127, 127);
int joy2_yvalue = map(analogRead(_JOY2_YAXIS), 0, 1023, 127, -127);
// Joystick 3
int joy3_xvalue = map(analogRead(_JOY3_XAXIS), 0, 1023, -127, 127);
int joy3_yvalue = map(analogRead(_JOY3_YAXIS), 0, 1023, 127, -127);
// Print the results to the serial monitor:
char buffer[256];
sprintf(buffer, "Stick 1: %4d/%4d | Stick 2: %4d/%4d | Stick 3: %4d/%4d", joy1_xvalue, joy1_yvalue, joy2_xvalue, joy2_yvalue, joy3_xvalue, joy3_yvalue);
Serial.println(buffer);
// Wait 1 second before the next loop
delay(1000);
}
Sure :)
This will spam the serial with the reading from A2, so probaly 0 or max unless it's wired up and you're moving it.
Arduino: 1.6.5 (Windows 7), TD: 1.26, Board: "Arduino Leonardo"
analog_a2_a3_test.ino: In function 'void loop()':
analog_a2_a3_test:56: error: expression cannot be used as a function
expression cannot be used as a function
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Did a quick sketch program that will output the values from A0, A1, A2, A3, A4 and A5 to the serial port every seconds. I've successfully tested it with my Arduino Mega2560 and it workedpush-buttons (so either -127 or 127 reading :))).
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -39/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -39/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
works :thumb:
although i don't know what this stuff means, i hope it does give you guys some info.
the output continues indefinitely, i copied a bunch and here it is:Code: [Select]Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -39/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -39/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -59/ 61 | Stick 2: -40/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 62 | Stick 2: -40/ 49 | Stick 3: -54/ 57
Stick 1: -61/ 63 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 58
Stick 1: -63/ 65 | Stick 2: -40/ 49 | Stick 3: -55/ 57
Stick 1: -62/ 64 | Stick 2: -40/ 49 | Stick 3: -55/ 57
that was with me doing nothing. not pressing any buttons or moving analog stick.
i just tried pressing the single button i have connected to pin 0. but nothing happens in controller properties page. the analog stick doesn't work at all either (i had it connected to A2-A3 during this serial monitor output recording). i guess that's probably by design? let me know if there's something i'm supposed to be doing other than just uploading the sketch and opening serial monitor.
Stick 1: -36/ 40 | Stick 2: -50/ 56 | Stick 3: -59/ 61
Stick 1: -36/ 40 | Stick 2: -50/ 56 | Stick 3: -60/ 62
Stick 1: -36/ 40 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: -36/ 40 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: -36/ 40 | Stick 2: -51/ 56 | Stick 3: -60/ 61
Stick 1: -41/ 40 | Stick 2: -50/ 56 | Stick 3: -59/ 60
Stick 1: -46/ -13 | Stick 2: -12/ 28 | Stick 3: -39/ 45
Stick 1: -46/ -13 | Stick 2: -10/ 25 | Stick 3: -36/ 42
Stick 1: -46/ -13 | Stick 2: -10/ 25 | Stick 3: -36/ 42
Stick 1: -46/ -13 | Stick 2: -9/ 24 | Stick 3: -35/ 42
Stick 1: -46/ -13 | Stick 2: -9/ 25 | Stick 3: -36/ 43
Stick 1: -46/ 40 | Stick 2: -48/ 53 | Stick 3: -57/ 59
Stick 1: -46/ 40 | Stick 2: -49/ 55 | Stick 3: -59/ 60
Stick 1: -46/ 40 | Stick 2: -50/ 56 | Stick 3: -60/ 62
Stick 1: -46/ 40 | Stick 2: -51/ 56 | Stick 3: -61/ 62
Stick 1: -46/ 40 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: -46/ 42 | Stick 2: -52/ 57 | Stick 3: -61/ 61
Stick 1: -48/ 102 | Stick 2: -93/ 87 | Stick 3: -81/ 76
Stick 1: -48/ 102 | Stick 2: -93/ 87 | Stick 3: -81/ 76
Stick 1: -48/ 102 | Stick 2: -93/ 86 | Stick 3: -80/ 75
Stick 1: -48/ 102 | Stick 2: -93/ 86 | Stick 3: -80/ 75
Stick 1: -48/ 102 | Stick 2: -93/ 86 | Stick 3: -80/ 76
Stick 1: -48/ 103 | Stick 2: -93/ 87 | Stick 3: -81/ 77
Stick 1: -48/ 45 | Stick 2: -55/ 59 | Stick 3: -62/ 63
Stick 1: -48/ 45 | Stick 2: -55/ 59 | Stick 3: -62/ 63
Stick 1: -48/ 45 | Stick 2: -55/ 60 | Stick 3: -63/ 64
Stick 1: -48/ 45 | Stick 2: -55/ 60 | Stick 3: -63/ 64
Stick 1: -48/ 45 | Stick 2: -55/ 60 | Stick 3: -63/ 64
Stick 1: -99/ 32 | Stick 2: -46/ 53 | Stick 3: -57/ 59
Stick 1: -99/ 32 | Stick 2: -45/ 52 | Stick 3: -56/ 57
Stick 1: -100/ 32 | Stick 2: -44/ 51 | Stick 3: -55/ 56
Stick 1: -99/ 32 | Stick 2: -44/ 50 | Stick 3: -54/ 55
Stick 1: -99/ 32 | Stick 2: -44/ 50 | Stick 3: -54/ 56
Stick 1: -51/ 40 | Stick 2: -49/ 54 | Stick 3: -57/ 58
Stick 1: -51/ 40 | Stick 2: -50/ 55 | Stick 3: -58/ 60
Stick 1: -51/ 40 | Stick 2: -50/ 56 | Stick 3: -59/ 61
Stick 1: -51/ 40 | Stick 2: -51/ 56 | Stick 3: -60/ 61
Stick 1: -51/ 40 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: 13/ 41 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: 13/ 41 | Stick 2: -51/ 57 | Stick 3: -61/ 62
Stick 1: 13/ 41 | Stick 2: -51/ 56 | Stick 3: -60/ 61
Stick 1: 13/ 41 | Stick 2: -51/ 56 | Stick 3: -59/ 60
Stick 1: 13/ 41 | Stick 2: -50/ 55 | Stick 3: -58/ 59
Stick 1: 13/ 41 | Stick 2: -50/ 55 | Stick 3: -57/ 58
Stick 1: -33/ 45 | Stick 2: -54/ 58 | Stick 3: -60/ 61
Stick 1: -33/ 45 | Stick 2: -53/ 56 | Stick 3: -58/ 59
Stick 1: -33/ 45 | Stick 2: -54/ 58 | Stick 3: -61/ 62
Stick 1: -33/ 45 | Stick 2: -54/ 58 | Stick 3: -61/ 62
Stick 1: -33/ 45 | Stick 2: -54/ 59 | Stick 3: -62/ 63
Stick 1: -33/ 45 | Stick 2: -55/ 60 | Stick 3: -63/ 63
Stick 1: -33/ 45 | Stick 2: -55/ 60 | Stick 3: -63/ 63
Stick 1: -33/ 45 | Stick 2: -55/ 59 | Stick 3: -62/ 62
Stick 1: -33/ 45 | Stick 2: -54/ 58 | Stick 3: -61/ 61
Stick 1: -33/ 45 | Stick 2: -54/ 58 | Stick 3: -60/ 60
Stick 1: -60/ 62 | Stick 2: -53/ 40 | Stick 3: -48/ 52
Stick 1: -61/ 64 | Stick 2: -52/ 40 | Stick 3: -49/ 53
Stick 1: -63/ 65 | Stick 2: -53/ 40 | Stick 3: -49/ 54
Stick 1: -64/ 66 | Stick 2: -53/ 40 | Stick 3: -49/ 54
Stick 1: -63/ 65 | Stick 2: -52/ 40 | Stick 3: -49/ 52
Stick 1: -61/ 62 | Stick 2: -45/ -13 | Stick 3: -10/ 23
Stick 1: -58/ 61 | Stick 2: -45/ -13 | Stick 3: -9/ 22
Stick 1: -57/ 59 | Stick 2: -45/ -13 | Stick 3: -9/ 22
Stick 1: -57/ 59 | Stick 2: -45/ -13 | Stick 3: -9/ 22
Stick 1: -58/ 60 | Stick 2: -45/ -13 | Stick 3: -9/ 23
Stick 1: -59/ 61 | Stick 2: -45/ -6 | Stick 3: -15/ 28
Stick 1: -61/ 64 | Stick 2: -45/ 40 | Stick 3: -47/ 52
Stick 1: -63/ 65 | Stick 2: -45/ 40 | Stick 3: -48/ 53
Stick 1: -63/ 65 | Stick 2: -45/ 40 | Stick 3: -48/ 52
Stick 1: -62/ 63 | Stick 2: -45/ 40 | Stick 3: -48/ 52
Stick 1: -60/ 62 | Stick 2: -46/ 102 | Stick 3: -89/ 81
Stick 1: -59/ 61 | Stick 2: -45/ 102 | Stick 3: -90/ 82
Stick 1: -59/ 61 | Stick 2: -45/ 102 | Stick 3: -90/ 83
Stick 1: -61/ 62 | Stick 2: -45/ 103 | Stick 3: -91/ 84
Stick 1: -62/ 63 | Stick 2: -45/ 102 | Stick 3: -91/ 85
Stick 1: -64/ 65 | Stick 2: -45/ 103 | Stick 3: -92/ 86
Stick 1: -65/ 66 | Stick 2: -44/ 45 | Stick 3: -53/ 57
Stick 1: -63/ 65 | Stick 2: -45/ 45 | Stick 3: -52/ 55
Stick 1: -62/ 64 | Stick 2: -44/ 44 | Stick 3: -52/ 54
Stick 1: -60/ 62 | Stick 2: -45/ 45 | Stick 3: -51/ 53
Stick 1: -59/ 62 | Stick 2: -100/ 43 | Stick 3: -50/ 53
Stick 1: -59/ 61 | Stick 2: -100/ 42 | Stick 3: -49/ 53
Stick 1: -60/ 62 | Stick 2: -100/ 42 | Stick 3: -50/ 54
Stick 1: -61/ 63 | Stick 2: -100/ 42 | Stick 3: -50/ 54
Stick 1: -63/ 65 | Stick 2: -100/ 42 | Stick 3: -51/ 55
Stick 1: -63/ 64 | Stick 2: -67/ 40 | Stick 3: -49/ 53
Stick 1: -63/ 65 | Stick 2: -50/ 41 | Stick 3: -49/ 53
Stick 1: -62/ 64 | Stick 2: -51/ 41 | Stick 3: -49/ 52
Stick 1: -61/ 63 | Stick 2: -50/ 41 | Stick 3: -48/ 51
Stick 1: -59/ 61 | Stick 2: -49/ 41 | Stick 3: -48/ 51
Stick 1: -58/ 58 | Stick 2: 11/ 49 | Stick 3: -54/ 56
Stick 1: -60/ 61 | Stick 2: 12/ 49 | Stick 3: -54/ 57
Stick 1: -61/ 62 | Stick 2: 12/ 49 | Stick 3: -55/ 57
Stick 1: -63/ 64 | Stick 2: 12/ 49 | Stick 3: -55/ 58
Stick 1: -64/ 64 | Stick 2: 12/ 49 | Stick 3: -55/ 58
Stick 1: -64/ 64 | Stick 2: 13/ 49 | Stick 3: -55/ 57
Stick 1: -63/ 64 | Stick 2: -33/ 45 | Stick 3: -53/ 55
Stick 1: -59/ 60 | Stick 2: -33/ 45 | Stick 3: -50/ 53
Stick 1: -58/ 60 | Stick 2: -33/ 45 | Stick 3: -51/ 53
Stick 1: -59/ 61 | Stick 2: -33/ 45 | Stick 3: -51/ 54
Stick 1: -60/ 61 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -61/ 63 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -62/ 64 | Stick 2: -33/ 45 | Stick 3: -53/ 56
Stick 1: -63/ 65 | Stick 2: -33/ 45 | Stick 3: -53/ 56
Stick 1: -63/ 65 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -63/ 64 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -61/ 63 | Stick 2: -33/ 45 | Stick 3: -52/ 54
Stick 1: -60/ 61 | Stick 2: -33/ 45 | Stick 3: -51/ 54
Stick 1: -59/ 61 | Stick 2: -33/ 45 | Stick 3: -51/ 54
Stick 1: -60/ 61 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -61/ 63 | Stick 2: -33/ 45 | Stick 3: -52/ 55
Stick 1: -62/ 64 | Stick 2: -33/ 45 | Stick 3: -53/ 56
Stick 1: -63/ 65 | Stick 2: -33/ 45 | Stick 3: -53/ 56
Stick 1: -54/ 59 | Stick 2: -64/ 66 | Stick 3: -33/ 45
Stick 1: -54/ 58 | Stick 2: -63/ 64 | Stick 3: -33/ 45
Stick 1: -53/ 57 | Stick 2: -62/ 63 | Stick 3: -33/ 45
Stick 1: -53/ 56 | Stick 2: -61/ 62 | Stick 3: -33/ 45
Stick 1: -52/ 56 | Stick 2: -60/ 62 | Stick 3: -33/ 45
Stick 1: -12/ 26 | Stick 2: -39/ 47 | Stick 3: -42/ -13
Stick 1: -11/ 26 | Stick 2: -39/ 47 | Stick 3: -42/ -13
Stick 1: -12/ 27 | Stick 2: -40/ 48 | Stick 3: -43/ -13
Stick 1: -12/ 27 | Stick 2: -41/ 49 | Stick 3: -43/ -13
Stick 1: -12/ 27 | Stick 2: -40/ 48 | Stick 3: -43/ -13
Stick 1: -48/ 53 | Stick 2: -59/ 61 | Stick 3: -43/ 39
Stick 1: -48/ 53 | Stick 2: -58/ 61 | Stick 3: -43/ 39
Stick 1: -48/ 53 | Stick 2: -58/ 60 | Stick 3: -42/ 38
Stick 1: -48/ 53 | Stick 2: -58/ 60 | Stick 3: -43/ 39
Stick 1: -51/ 55 | Stick 2: -60/ 63 | Stick 3: -43/ 42
Stick 1: -91/ 85 | Stick 2: -83/ 79 | Stick 3: -43/ 99
Stick 1: -92/ 86 | Stick 2: -85/ 81 | Stick 3: -50/ 99
Stick 1: -92/ 87 | Stick 2: -85/ 81 | Stick 3: -50/ 100
Stick 1: -92/ 86 | Stick 2: -85/ 81 | Stick 3: -50/ 100
Stick 1: -92/ 86 | Stick 2: -84/ 80 | Stick 3: -50/ 99
Stick 1: -54/ 57 | Stick 2: -62/ 64 | Stick 3: -49/ 45
Stick 1: -53/ 56 | Stick 2: -61/ 63 | Stick 3: -49/ 45
Stick 1: -53/ 56 | Stick 2: -61/ 63 | Stick 3: -49/ 45
Stick 1: -53/ 57 | Stick 2: -62/ 63 | Stick 3: -49/ 45
Stick 1: -54/ 57 | Stick 2: -63/ 65 | Stick 3: -49/ 45
Stick 1: -54/ 58 | Stick 2: -64/ 66 | Stick 3: -99/ 46
Stick 1: -55/ 59 | Stick 2: -65/ 67 | Stick 3: -99/ 46
Stick 1: -55/ 59 | Stick 2: -64/ 67 | Stick 3: -99/ 46
Stick 1: -54/ 58 | Stick 2: -63/ 66 | Stick 3: -99/ 46
Stick 1: -54/ 58 | Stick 2: -63/ 65 | Stick 3: -99/ 46
Stick 1: -49/ 54 | Stick 2: -59/ 61 | Stick 3: -52/ 40
Stick 1: -49/ 53 | Stick 2: -59/ 61 | Stick 3: -52/ 40
Stick 1: -49/ 53 | Stick 2: -59/ 61 | Stick 3: -52/ 40
Stick 1: -49/ 54 | Stick 2: -60/ 62 | Stick 3: -52/ 40
Stick 1: -50/ 55 | Stick 2: -60/ 63 | Stick 3: -52/ 40
Stick 1: -50/ 55 | Stick 2: -62/ 64 | Stick 3: -49/ 40
Stick 1: -51/ 56 | Stick 2: -62/ 64 | Stick 3: 11/ 41
Stick 1: -51/ 56 | Stick 2: -62/ 64 | Stick 3: 12/ 41
Stick 1: -51/ 56 | Stick 2: -62/ 63 | Stick 3: 12/ 41
Stick 1: -51/ 55 | Stick 2: -61/ 62 | Stick 3: 12/ 41
Stick 1: -50/ 55 | Stick 2: -60/ 61 | Stick 3: 13/ 41
Stick 1: -50/ 54 | Stick 2: -59/ 60 | Stick 3: 13/ 41
Stick 1: -49/ 53 | Stick 2: -59/ 61 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -59/ 61 | Stick 3: -33/ 40
Stick 1: -50/ 55 | Stick 2: -61/ 63 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -60/ 62 | Stick 3: -33/ 40
Stick 1: -50/ 56 | Stick 2: -62/ 64 | Stick 3: -33/ 40
Stick 1: -50/ 56 | Stick 2: -62/ 64 | Stick 3: -33/ 40
Stick 1: -50/ 56 | Stick 2: -62/ 64 | Stick 3: -33/ 40
Stick 1: -50/ 55 | Stick 2: -61/ 63 | Stick 3: -33/ 40
Stick 1: -50/ 55 | Stick 2: -60/ 62 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -59/ 61 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -59/ 61 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -59/ 61 | Stick 3: -33/ 40
Stick 1: -49/ 54 | Stick 2: -60/ 62 | Stick 3: -33/ 40
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
// Update joystick state
Joystick.send_now();
}
Sorry, im a little late to the coding party. What is the current status?
Temp= map(analogRead(5), OVERVAL, 1024 - OVERVAL, -127, 127);
Serial.println(Temp)
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Sorry, im a little late to the coding party. What is the current status?
Here is a code for teensy for one joystick in joystick mode and one joystick as a hat + those earlier buttons:Code: [Select]//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
// Update joystick state
Joystick.send_now();
}
I tested this on Teensy LC with vita stick.
Sorry, im a little late to the coding party. What is the current status?
Status is apparently the Teensy doesn't play nice with xpadder but your code works fine with my Linux replacement, so hopefully that's not true.
The other problem is "digitising" an analog stick to just press buttons when pushed past a threshold. Reading your code I had a brainwave - mine was based on raw values not mapped like the axes are, but this improved code still doesn't work despite printing values of 57 and -68 (my analog is not a nice accurate vita one ) If you could tell me what really important thing I'm missing before I go mad that would be great :)) (This is back on Arduino as my Teensy has no breadboard friendly pins)Code: [Select]Temp= map(analogRead(5), OVERVAL, 1024 - OVERVAL, -127, 127);
Serial.println(Temp)
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
(Temp < -30)
In "real" C world this would be ok, but Im not sure if the arduino compilers like this.
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define DIGI_X 4
#define DIGI_Y 5
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xdigi;
int Ydigi;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
// Digitised stick computations
Xdigi = map(analogRead(DIGI_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
(Xdigi < -30) ? buttonState[9] = 1 : buttonState[9] = 0;
(Xdigi > 30) ? buttonState[10] = 1 : buttonState[10] = 0;
Ydigi = map(analogRead(DIGI_Y), OVERVAL, 1024 - OVERVAL, 0, 1023);
(Ydigi < -30) ? buttonState[11] = 1 : buttonState[11] = 0;
(Ydigi > 30) ? buttonState[12] = 1 : buttonState[12] = 0;
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
// Update joystick state
Joystick.send_now();
}
Okay, I got it to work :thumb:
Xpadder won't autodetect analog input from the teensy, but it will detect it if it's manually set up :))
So, at this point I'm going to resume planning to implement the teensy :cool:
Could somebody add one more analog stick to this sketch in a way such that it activates buttons 9 through 13?
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
It could be this:Code: [Select](Temp < -30)
In "real" C world this would be ok, but Im not sure if the arduino compilers like this.
int temp = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//Serial.println("Joystick ready");
}
void loop() {
// put your main code here, to run repeatedly:
temp += 1;
(temp < 5) ? Serial.println("low") : Serial.println("high");
delay(1000);
}
low
low
low
low
low
high
high
high
IsLEDOn = !IsLEDOn; // toggle value of IsLEDOn
digitalWrite(LEDPin, IsLEDOn ? HIGH : LOW)
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
Here:Code: [Select]//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
I compiled it, but didn't test with a joystick.
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
The hatThreshold constant is the null zone for the hat. Anything inside a square of 2x hatThreshold size, centered around "center", is considered NULL.
Maybe you could try to compute the linear distance between the center and your position, instead of comparing toward axis position.
Maybe the problem has more to do with the use of 0 / 1 instead of true / false for the buttonState.Code: [Select](Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
The hatThreshold constant is the null zone for the hat. Anything inside a square of 2x hatThreshold size, centered around "center", is considered NULL.
Maybe you could try to compute the linear distance between the center and your position, instead of comparing toward axis position.
ok, so i just need to make the 128 bigger and test for the desired nullzone :thumb:
the way it's coded is with a square nullzone? i didn't realize that. square is actually ideal for digital use because of how it minimizes the chance of inadvertent keypresses due to imperfect movement.
amazing progress!:thumb:
Big day with the controller today :)
It's been since just before I started this thread in mid August that I played league of legends. Today I finally got to somewhat come out of retirement and actually play the game. Obviously, for this project, it's a pretty big step :p
What I did was, I just wired up the single analog stick that I have, and with that and my eight buttons I was able to play with basic functionality. Nothing fancy, no laughs, dances, or even the ability to ward or level up my abilities with hot keys. Just basic functionality of movement, basic attacks, all four abilities, and awesome camera control :cool:
I spent the whole day playing on and off, figuring out which basic commands I can map to the limited controls I have at this time and essentially having to relearn how to play this game with a totally new control scheme for about the sixth or seventh time. With this version of that activity one of the more demanding since I'm having to newly learn to use this controller, and having to learn to play league of legends with a pen tablet, and having everything be switched from left to right :confused:
This kind of relearning of the game and all the establishing of new muscle memory is nothing new for me, and by the end of the day I could basically play the game somewhat normally. This process usually takes a full week for me to be able to regain the entirety of my prior abilities.
At any rate, the good news is that the device works phenomenally. I'm not sure yet because I'm still making some adjustments, but I'm pretty sure it's the best controller I've ever used :thumb:
In the course of making observations and experiencing various things during gameplay, I discovered that the device is not best as a knee or thigh device. Rather, this device finds itself more at home on the chest/belly. Although I wasn't expecting it, this wasn't a big surprise to me as I have previously played with a Logitech M570 in the same position on my chest along with the razor orbweaver on my belly. if you're a sofa or bed gamer, chest and belly is often the home of a device of some sort due to the corpse like position you can assume - elbows bent with zero muscles firing aside from fingers and thumb - which is probably the most ergonomic position the human body can get into :))
At any rate, this is what I mean by the position in which the device finds itself most at home.
(Attachment Link)
at least for me because of how i game in a zero gravity chair which has me fairly well laid out like a corpse, it works well to somewhat assume the figure of a corpse for maximum comfort.
by re-purposing the device as a chest rather than thigh device, i found the effort required of the wrist and forearm to dramatically plummet. the device was darned comfortable and easy to use on my thigh, but once i dropped it on my chest, just laid on its face rather than propped up on its base, and felt the difference in how little was required of small muscle groups for stability and leverage to hit keys, i knew a change had to be made.
the change required is a swinging outward of the outside leg by about 15 degrees or something. the reason it's needed is that when i lay the device on my chest, my finger positions get rotated clockwise out of the device enough to make wrong the position of the outside leg and the keys affixed to it (my fingers are not inserted as deeply into the device - their grip is relaxed more and they just don't go as deep).
this means a major teardown, probably the 10th at this point.
i've taken these pics as reference for my keycap orientations:
(Attachment Link)
(Attachment Link)
have removed the analog stick on top and proceeded with major teardown
(Attachment Link)
i've made a new cut as you can see which allows for repositioning the angle of the outside leg such that it better faces the backs of my fingers' 2nd segments now that they have moved due to the new chest/belly method of use.
you can see the original angel on bottom line cut, and the new angle to be in the top line cut. i'll reassemble with sugru tomorrow.
(Attachment Link)
That thing looks mean! Like a piece of Malphite. :D
Great to see the progress on this!
I'm impressed that the wiring stays working through all these teardowns - good work!
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
for (int i = 0 ; i < 8 ; i++)
for (int i = 0 ; i < 9 ; i++)
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 9 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
If pin 8 is also an analog then you're right - it won't work. If that is the case change the 8 in mypins[] to a pin that's not an analog, or comment out the analog code for it which isn't in use
//PINS
#define STICK_X 0
#define STICK_Y 1
#define OVERVAL 0
int Xstick;
int Ystick;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 9 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
// Update joystick state
Joystick.send_now();
}
If you touch a wire between pin 8 and ground and that presses a button the problem is your switch/wiring, if it doesn't it's the code. The code still looks good and there's nothing special about pin 8, so hopefully it just works.
If flash is so important why not put it on one of the other switches that work while you wait?
It's a 2 minute job to switch the 8 to a 9 and poke it with a wire, you know you want to :thumb:
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
should be like this: for (int i = 0 ; i < 9 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
This:
I've missed your updates but happy to hear there's a good reason for it!:thumb:
Talk to you soon when it's all wired up :)
(Temp < -30) ? buttonState[12] = 1 : buttonState[12] = 0;
(Temp > 30) ? buttonState[13] = 1 : buttonState[13] = 0;
buttonState[12] = Temp < -30;
buttonState[13] = Temp > 30;
question, which one of these pinouts do i connect the power?I've designed the board to be used for both older and newer analog stick. VCC pads are not connected each other on the board, so connect them to VCC. If you ignore the silk on the board, you can use the board as normal break out board.
(Attachment Link)
the product page says they're all for power? maybe any of the 3 can be used?
https://oshpark.com/shared_projects/2p7rQYx8
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
Serial.print("Xhat: ");
Serial.println(Xhat);
Serial.print("Yhat: ");
Serial.println(Yhat);
Serial.println("---------------------");
delay(50);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
Dont use this for gaming. (I added 50 ms delay to the loop)
Arduino: 1.6.5 (Windows 7), TD: 1.26, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz optimized (overclock), US English"
Sketch uses 19,896 bytes (7%) of program storage space. Maximum is 262,144 bytes.
Global variables use 6,532 bytes (9%) of dynamic memory, leaving 59,004 bytes for local variables. Maximum is 65,536 bytes.
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
no serial port name defined
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Xhat: 81
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 80
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 488
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 488
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 72
Yhat: 488
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 488
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 528
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 488
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 488
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 71
Yhat: 488
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 71
Yhat: 488
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 488
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 488
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 79
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 81
Yhat: 488
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 90
Yhat: 489
---------------------
Xhat: 92
Yhat: 489
---------------------
Xhat: 92
Yhat: 489
---------------------
Xhat: 90
Yhat: 488
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 85
Yhat: 489
---------------------
Xhat: 85
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 90
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 82
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 89
Yhat: 488
---------------------
Xhat: 87
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 29
Yhat: 488
---------------------
Xhat: 82
Yhat: 488
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 29
Yhat: 488
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 30
Yhat: 488
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 30
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 493
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 77
Yhat: 488
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 60
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 54
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 62
Yhat: 488
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 63
Yhat: 488
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 60
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 78
Yhat: 488
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 77
Yhat: 488
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 488
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 88
Yhat: 489
---------------------
Xhat: 89
Yhat: 489
---------------------
Xhat: 86
Yhat: 488
---------------------
Xhat: 86
Yhat: 488
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 85
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 85
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 74
Yhat: 488
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 66
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 56
Yhat: 490
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 75
Yhat: 488
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 74
Yhat: 488
---------------------
Xhat: 75
Yhat: 488
---------------------
Xhat: 81
Yhat: 489
---------------------
Xhat: 76
Yhat: 488
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 68
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 74
Yhat: 488
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 78
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 85
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 67
Yhat: 489
---------------------
Xhat: 66
Yhat: 489
---------------------
Xhat: 67
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 66
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 72
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 54
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 63
Yhat: 488
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 83
Yhat: 489
---------------------
Xhat: 61
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 54
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 75
Yhat: 488
---------------------
Xhat: 76
Yhat: 488
---------------------
Xhat: 84
Yhat: 489
---------------------
Xhat: 79
Yhat: 488
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 71
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 56
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 24
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 54
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 61
Yhat: 489
---------------------
Xhat: 62
Yhat: 488
---------------------
Xhat: 63
Yhat: 488
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 58
Yhat: 489
---------------------
Xhat: 57
Yhat: 489
---------------------
Xhat: 61
Yhat: 489
---------------------
Xhat: 60
Yhat: 488
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 66
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 65
Yhat: 489
---------------------
Xhat: 57
Yhat: 489
---------------------
Xhat: 67
Yhat: 489
---------------------
Xhat: 64
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 61
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 68
Yhat: 489
---------------------
Xhat: 66
Yhat: 489
---------------------
Xhat: 59
Yhat: 489
---------------------
Xhat: 55
Yhat: 489
---------------------
Xhat: 58
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 57
Yhat: 489
---------------------
Xhat: 51
Yhat: 489
---------------------
Xhat: 25
Yhat: 489
---------------------
Xhat: 60
Yhat: 489
---------------------
Xhat: 60
Yhat: 489
---------------------
Xhat: 59
Yhat: 489
---------------------
Xhat: 55
Yhat: 489
---------------------
Xhat: 60
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 61
Yhat: 489
---------------------
Xhat: 59
Yhat: 488
---------------------
Xhat: 59
Yhat: 489
---------------------
Xhat: 58
Yhat: 489
---------------------
Xhat: 57
Yhat: 489
---------------------
Xhat: 57
Yhat: 489
---------------------
Xhat: 56
Yhat: 489
---------------------
Xhat: 56
Yhat: 488
---------------------
Xhat: 55
Yhat: 489
---------------------
Xhat: 53
Yhat: 489
---------------------
Xhat: 55
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 80
Yhat: 489
---------------------
Xhat: 86
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 79
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 77
Yhat: 489
---------------------
Xhat: 76
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 75
Yhat: 489
---------------------
Xhat: 73
Yhat: 489
---------------------
Xhat: 62
Yhat: 489
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 69
Yhat: 489
---------------------
Xhat: 68
Yhat: 488
---------------------
Xhat: 70
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 74
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 56
Yhat: 489
---------------------
Xhat: 27
Yhat: 489
---------------------
Xhat: 63
Yhat: 489
---------------------
Xhat: 67
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 58
Yhat: 489
---------------------
Xhat: 28
Yhat: 489
---------------------
Xhat: 29
Yhat: 489
---------------------
Xhat: 55
Yhat: 489
---------------------
Xhat: 50
Yhat: 488
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 26
Yhat: 489
---------------------
Xhat: 5
Yhat: 486
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 481
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 483
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 476
---------------------
Xhat: 5
Yhat: 432
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 416
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 416
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 4
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 4
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 418
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 417
---------------------
Xhat: 5
Yhat: 415
---------------------
Xhat: 5
Yhat: 484
---------------------
Xhat: 5
Yhat: 486
---------------------
Xhat: 5
Yhat: 489
---------------------
Xhat: 5
Yhat: 489
---------------------
Xhat: 5
Yhat: 489
---------------------
Xhat: 5
Yhat: 490
---------------------
Xhat: 5
Yhat: 489
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 486
---------------------
Xhat: 5
Yhat: 475
---------------------
Xhat: 5
Yhat: 202
---------------------
Xhat: 5
Yhat: 197
---------------------
Xhat: 5
Yhat: 192
---------------------
Xhat: 5
Yhat: 189
---------------------
Xhat: 5
Yhat: 190
---------------------
Xhat: 5
Yhat: 177
---------------------
Xhat: 5
Yhat: 198
---------------------
Xhat: 5
Yhat: 182
---------------------
Xhat: 5
Yhat: 192
---------------------
Xhat: 5
Yhat: 260
---------------------
Xhat: 5
Yhat: 175
---------------------
Xhat: 5
Yhat: 225
---------------------
Xhat: 5
Yhat: 195
---------------------
Xhat: 5
Yhat: 232
---------------------
Xhat: 5
Yhat: 196
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 196
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 198
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 198
---------------------
Xhat: 5
Yhat: 271
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 6
Yhat: 198
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 247
---------------------
Xhat: 5
Yhat: 199
---------------------
Xhat: 5
Yhat: 199
---------------------
Xhat: 5
Yhat: 201
---------------------
Xhat: 5
Yhat: 201
---------------------
Xhat: 5
Yhat: 266
---------------------
Xhat: 5
Yhat: 201
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 159
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 217
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 4
Yhat: 190
---------------------
Xhat: 4
Yhat: 240
---------------------
Xhat: 5
Yhat: 237
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 202
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 232
---------------------
Xhat: 5
Yhat: 232
---------------------
Xhat: 5
Yhat: 223
---------------------
Xhat: 5
Yhat: 251
---------------------
Xhat: 5
Yhat: 232
---------------------
Xhat: 5
Yhat: 234
---------------------
Xhat: 5
Yhat: 241
---------------------
Xhat: 5
Yhat: 256
---------------------
Xhat: 5
Yhat: 245
---------------------
Xhat: 5
Yhat: 249
---------------------
Xhat: 5
Yhat: 231
---------------------
Xhat: 5
Yhat: 222
---------------------
Xhat: 5
Yhat: 244
---------------------
Xhat: 5
Yhat: 236
---------------------
Xhat: 5
Yhat: 219
---------------------
Xhat: 5
Yhat: 210
---------------------
Xhat: 5
Yhat: 228
---------------------
Xhat: 5
Yhat: 221
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 194
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 209
---------------------
Xhat: 5
Yhat: 209
---------------------
Xhat: 5
Yhat: 211
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 210
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 4
Yhat: 205
---------------------
Xhat: 5
Yhat: 189
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 227
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 197
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 202
---------------------
Xhat: 5
Yhat: 197
---------------------
Xhat: 4
Yhat: 207
---------------------
Xhat: 5
Yhat: 199
---------------------
Xhat: 5
Yhat: 195
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 203
---------------------
Xhat: 4
Yhat: 207
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 6
Yhat: 220
---------------------
Xhat: 5
Yhat: 191
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 237
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 209
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 208
---------------------
Xhat: 5
Yhat: 175
---------------------
Xhat: 5
Yhat: 208
---------------------
Xhat: 5
Yhat: 224
---------------------
Xhat: 5
Yhat: 174
---------------------
Xhat: 5
Yhat: 211
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 216
---------------------
Xhat: 5
Yhat: 246
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 6
Yhat: 224
---------------------
Xhat: 5
Yhat: 264
---------------------
Xhat: 4
Yhat: 224
---------------------
Xhat: 5
Yhat: 260
---------------------
Xhat: 5
Yhat: 223
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 201
---------------------
Xhat: 5
Yhat: 228
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 198
---------------------
Xhat: 5
Yhat: 151
---------------------
Xhat: 5
Yhat: 206
---------------------
Xhat: 5
Yhat: 211
---------------------
Xhat: 5
Yhat: 205
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 204
---------------------
Xhat: 5
Yhat: 207
---------------------
Xhat: 5
Yhat: 197
---------------------
Xhat: 5
Yhat: 200
---------------------
Xhat: 5
Yhat: 210
---------------------
Xhat: 5
Yhat: 229
---------------------
Xhat: 5
Yhat: 419
---------------------
Xhat: 5
Yhat: 486
---------------------
Xhat: 5
Yhat: 485
---------------------
Xhat: 5
Yhat: 489
---------------------
Xhat: 5
Yhat: 498
---------------------
Xhat: 5
Yhat: 497
---------------------
Xhat: 5
Yhat: 590
---------------------
Xhat: 5
Yhat: 727
---------------------
Xhat: 5
Yhat: 727
---------------------
Xhat: 5
Yhat: 726
---------------------
Xhat: 5
Yhat: 727
---------------------
Xhat: 5
Yhat: 730
---------------------
Xhat: 5
Yhat: 733
---------------------
Xhat: 5
Yhat: 734
---------------------
Xhat: 5
Yhat: 735
---------------------
Xhat: 5
Yhat: 738
---------------------
Xhat: 5
Yhat: 739
---------------------
Xhat: 5
Yhat: 738
---------------------
Xhat: 5
Yhat: 737
---------------------
Xhat: 5
Yhat: 737
---------------------
Xhat: 5
Yhat: 737
---------------------
Xhat: 5
Yhat: 736
---------------------
Xhat: 5
Yhat: 736
---------------------
Xhat: 5
Yhat: 750
---------------------
Xhat: 5
Yhat: 736
---------------------
Xhat: 5
Yhat: 735
---------------------
Xhat: 5
Yhat: 735
---------------------
Xhat: 5
Yhat: 733
---------------------
Xhat: 5
Yhat: 732
---------------------
Xhat: 5
Yhat: 731
---------------------
Xhat: 5
Yhat: 731
---------------------
Xhat: 5
Yhat: 731
---------------------
Xhat: 5
Yhat: 729
---------------------
Xhat: 5
Yhat: 730
---------------------
Xhat: 5
Yhat: 729
---------------------
Xhat: 5
Yhat: 729
---------------------
Xhat: 5
Yhat: 729
---------------------
Xhat: 5
Yhat: 726
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 722
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 723
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 722
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 721
---------------------
Xhat: 5
Yhat: 720
---------------------
Xhat: 5
Yhat: 719
---------------------
Xhat: 5
Yhat: 719
---------------------
Xhat: 5
Yhat: 718
---------------------
Xhat: 5
Yhat: 718
---------------------
Xhat: 5
Yhat: 718
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 718
---------------------
Xhat: 5
Yhat: 718
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 716
---------------------
Xhat: 5
Yhat: 717
---------------------
Xhat: 5
Yhat: 715
---------------------
Xhat: 5
Yhat: 715
---------------------
Xhat: 5
Yhat: 713
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 711
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 4
Yhat: 711
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 710
---------------------
Xhat: 5
Yhat: 703
---------------------
Xhat: 5
Yhat: 702
---------------------
Xhat: 5
Yhat: 701
---------------------
Xhat: 5
Yhat: 636
---------------------
Xhat: 5
Yhat: 488
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 486
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 4
Yhat: 485
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Xhat: 5
Yhat: 487
---------------------
Could you get the values from the stick when it is working after you have reconnected the wires ?
Xhat: 549
Yhat: 493
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 554
Yhat: 498
---------------------
Xhat: 548
Yhat: 499
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 555
Yhat: 492
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 550
Yhat: 491
---------------------
Xhat: 550
Yhat: 491
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 548
Yhat: 495
---------------------
Xhat: 548
Yhat: 499
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 552
Yhat: 498
---------------------
Xhat: 553
Yhat: 492
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 548
Yhat: 489
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 555
Yhat: 499
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 550
Yhat: 498
---------------------
Xhat: 549
Yhat: 500
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 500
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 553
Yhat: 490
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 552
Yhat: 497
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 549
Yhat: 499
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 550
Yhat: 498
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 550
Yhat: 492
---------------------
Xhat: 549
Yhat: 489
---------------------
Xhat: 555
Yhat: 499
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 550
Yhat: 500
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 554
Yhat: 500
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 549
Yhat: 500
---------------------
Xhat: 551
Yhat: 499
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 554
Yhat: 500
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 553
Yhat: 492
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 548
Yhat: 490
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 550
Yhat: 490
---------------------
Xhat: 552
Yhat: 500
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 552
Yhat: 498
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 550
Yhat: 498
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 553
Yhat: 500
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 551
Yhat: 499
---------------------
Xhat: 555
Yhat: 496
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 548
Yhat: 494
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 548
Yhat: 498
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 498
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 551
Yhat: 489
---------------------
Xhat: 555
Yhat: 492
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 552
Yhat: 489
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 549
Yhat: 498
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 555
Yhat: 492
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 551
Yhat: 499
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 554
Yhat: 500
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 548
Yhat: 499
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 500
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 548
Yhat: 496
---------------------
Xhat: 552
Yhat: 498
---------------------
Xhat: 551
Yhat: 499
---------------------
Xhat: 549
Yhat: 498
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 551
Yhat: 499
---------------------
Xhat: 551
Yhat: 491
---------------------
Xhat: 552
Yhat: 499
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 549
Yhat: 498
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 550
Yhat: 498
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 500
---------------------
Xhat: 551
Yhat: 490
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 553
Yhat: 491
---------------------
Xhat: 548
Yhat: 498
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 548
Yhat: 494
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 555
Yhat: 497
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 554
Yhat: 498
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 551
Yhat: 489
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 549
Yhat: 498
---------------------
Xhat: 552
Yhat: 500
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 547
Yhat: 497
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 548
Yhat: 488
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 533
Yhat: 487
---------------------
Xhat: 538
Yhat: 489
---------------------
Xhat: 520
Yhat: 493
---------------------
Xhat: 519
Yhat: 490
---------------------
Xhat: 511
Yhat: 489
---------------------
Xhat: 420
Yhat: 490
---------------------
Xhat: 469
Yhat: 492
---------------------
Xhat: 541
Yhat: 488
---------------------
Xhat: 537
Yhat: 489
---------------------
Xhat: 548
Yhat: 491
---------------------
Xhat: 546
Yhat: 490
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 556
Yhat: 491
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 548
Yhat: 496
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 550
Yhat: 491
---------------------
Xhat: 552
Yhat: 497
---------------------
Xhat: 552
Yhat: 489
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 498
---------------------
Xhat: 554
Yhat: 499
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 552
Yhat: 498
---------------------
Xhat: 550
Yhat: 499
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 550
Yhat: 491
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 551
Yhat: 490
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 553
Yhat: 499
---------------------
Xhat: 548
Yhat: 493
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 555
Yhat: 499
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 492
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 556
Yhat: 496
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 550
Yhat: 490
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 555
Yhat: 495
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 556
Yhat: 497
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 548
Yhat: 496
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 555
Yhat: 497
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 556
Yhat: 492
---------------------
Xhat: 555
Yhat: 495
---------------------
Xhat: 555
Yhat: 491
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 547
Yhat: 492
---------------------
Xhat: 547
Yhat: 486
---------------------
Xhat: 535
Yhat: 486
---------------------
Xhat: 543
Yhat: 488
---------------------
Xhat: 511
Yhat: 479
---------------------
Xhat: 490
Yhat: 482
---------------------
Xhat: 461
Yhat: 480
---------------------
Xhat: 437
Yhat: 485
---------------------
Xhat: 405
Yhat: 481
---------------------
Xhat: 361
Yhat: 483
---------------------
Xhat: 307
Yhat: 481
---------------------
Xhat: 285
Yhat: 464
---------------------
Xhat: 281
Yhat: 464
---------------------
Xhat: 386
Yhat: 464
---------------------
Xhat: 539
Yhat: 484
---------------------
Xhat: 548
Yhat: 488
---------------------
Xhat: 546
Yhat: 488
---------------------
Xhat: 550
Yhat: 489
---------------------
Xhat: 543
Yhat: 486
---------------------
Xhat: 551
Yhat: 487
---------------------
Xhat: 537
Yhat: 482
---------------------
Xhat: 350
Yhat: 437
---------------------
Xhat: 273
Yhat: 425
---------------------
Xhat: 271
Yhat: 428
---------------------
Xhat: 272
Yhat: 428
---------------------
Xhat: 273
Yhat: 426
---------------------
Xhat: 275
Yhat: 418
---------------------
Xhat: 273
Yhat: 419
---------------------
Xhat: 272
Yhat: 418
---------------------
Xhat: 272
Yhat: 422
---------------------
Xhat: 272
Yhat: 434
---------------------
Xhat: 272
Yhat: 433
---------------------
Xhat: 271
Yhat: 436
---------------------
Xhat: 271
Yhat: 433
---------------------
Xhat: 272
Yhat: 434
---------------------
Xhat: 271
Yhat: 430
---------------------
Xhat: 271
Yhat: 432
---------------------
Xhat: 272
Yhat: 439
---------------------
Xhat: 271
Yhat: 438
---------------------
Xhat: 272
Yhat: 435
---------------------
Xhat: 271
Yhat: 438
---------------------
Xhat: 271
Yhat: 442
---------------------
Xhat: 272
Yhat: 439
---------------------
Xhat: 272
Yhat: 443
---------------------
Xhat: 271
Yhat: 437
---------------------
Xhat: 271
Yhat: 439
---------------------
Xhat: 271
Yhat: 439
---------------------
Xhat: 272
Yhat: 439
---------------------
Xhat: 273
Yhat: 439
---------------------
Xhat: 271
Yhat: 436
---------------------
Xhat: 271
Yhat: 435
---------------------
Xhat: 271
Yhat: 435
---------------------
Xhat: 272
Yhat: 436
---------------------
Xhat: 271
Yhat: 433
---------------------
Xhat: 271
Yhat: 430
---------------------
Xhat: 271
Yhat: 428
---------------------
Xhat: 271
Yhat: 423
---------------------
Xhat: 272
Yhat: 424
---------------------
Xhat: 271
Yhat: 421
---------------------
Xhat: 272
Yhat: 419
---------------------
Xhat: 272
Yhat: 421
---------------------
Xhat: 272
Yhat: 421
---------------------
Xhat: 271
Yhat: 419
---------------------
Xhat: 272
Yhat: 420
---------------------
Xhat: 272
Yhat: 423
---------------------
Xhat: 272
Yhat: 417
---------------------
Xhat: 272
Yhat: 419
---------------------
Xhat: 271
Yhat: 420
---------------------
Xhat: 272
Yhat: 421
---------------------
Xhat: 274
Yhat: 421
---------------------
Xhat: 274
Yhat: 416
---------------------
Xhat: 274
Yhat: 417
---------------------
Xhat: 271
Yhat: 421
---------------------
Xhat: 273
Yhat: 418
---------------------
Xhat: 273
Yhat: 419
---------------------
Xhat: 271
Yhat: 420
---------------------
Xhat: 272
Yhat: 422
---------------------
Xhat: 273
Yhat: 422
---------------------
Xhat: 272
Yhat: 421
---------------------
Xhat: 273
Yhat: 420
---------------------
Xhat: 274
Yhat: 422
---------------------
Xhat: 274
Yhat: 420
---------------------
Xhat: 274
Yhat: 420
---------------------
Xhat: 273
Yhat: 417
---------------------
Xhat: 274
Yhat: 421
---------------------
Xhat: 274
Yhat: 419
---------------------
Xhat: 273
Yhat: 417
---------------------
Xhat: 274
Yhat: 414
---------------------
Xhat: 276
Yhat: 416
---------------------
Xhat: 275
Yhat: 415
---------------------
Xhat: 276
Yhat: 418
---------------------
Xhat: 274
Yhat: 417
---------------------
Xhat: 276
Yhat: 415
---------------------
Xhat: 273
Yhat: 413
---------------------
Xhat: 274
Yhat: 407
---------------------
Xhat: 273
Yhat: 415
---------------------
Xhat: 273
Yhat: 406
---------------------
Xhat: 273
Yhat: 411
---------------------
Xhat: 273
Yhat: 406
---------------------
Xhat: 274
Yhat: 414
---------------------
Xhat: 277
Yhat: 409
---------------------
Xhat: 277
Yhat: 412
---------------------
Xhat: 274
Yhat: 414
---------------------
Xhat: 273
Yhat: 407
---------------------
Xhat: 275
Yhat: 405
---------------------
Xhat: 278
Yhat: 405
---------------------
Xhat: 275
Yhat: 400
---------------------
Xhat: 273
Yhat: 409
---------------------
Xhat: 276
Yhat: 405
---------------------
Xhat: 275
Yhat: 408
---------------------
Xhat: 285
Yhat: 417
---------------------
Xhat: 539
Yhat: 492
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 555
Yhat: 497
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 556
Yhat: 493
---------------------
Xhat: 568
Yhat: 492
---------------------
Xhat: 572
Yhat: 489
---------------------
Xhat: 575
Yhat: 490
---------------------
Xhat: 583
Yhat: 498
---------------------
Xhat: 679
Yhat: 493
---------------------
Xhat: 806
Yhat: 496
---------------------
Xhat: 820
Yhat: 488
---------------------
Xhat: 820
Yhat: 493
---------------------
Xhat: 817
Yhat: 494
---------------------
Xhat: 823
Yhat: 498
---------------------
Xhat: 819
Yhat: 506
---------------------
Xhat: 823
Yhat: 517
---------------------
Xhat: 820
Yhat: 520
---------------------
Xhat: 824
Yhat: 526
---------------------
Xhat: 817
Yhat: 526
---------------------
Xhat: 818
Yhat: 540
---------------------
Xhat: 817
Yhat: 542
---------------------
Xhat: 816
Yhat: 540
---------------------
Xhat: 812
Yhat: 542
---------------------
Xhat: 815
Yhat: 554
---------------------
Xhat: 799
Yhat: 582
---------------------
Xhat: 800
Yhat: 591
---------------------
Xhat: 800
Yhat: 586
---------------------
Xhat: 800
Yhat: 587
---------------------
Xhat: 797
Yhat: 583
---------------------
Xhat: 800
Yhat: 580
---------------------
Xhat: 803
Yhat: 589
---------------------
Xhat: 800
Yhat: 581
---------------------
Xhat: 800
Yhat: 583
---------------------
Xhat: 801
Yhat: 584
---------------------
Xhat: 805
Yhat: 582
---------------------
Xhat: 802
Yhat: 592
---------------------
Xhat: 801
Yhat: 583
---------------------
Xhat: 805
Yhat: 587
---------------------
Xhat: 802
Yhat: 591
---------------------
Xhat: 801
Yhat: 581
---------------------
Xhat: 805
Yhat: 582
---------------------
Xhat: 800
Yhat: 582
---------------------
Xhat: 802
Yhat: 593
---------------------
Xhat: 800
Yhat: 581
---------------------
Xhat: 804
Yhat: 582
---------------------
Xhat: 801
Yhat: 588
---------------------
Xhat: 801
Yhat: 591
---------------------
Xhat: 803
Yhat: 584
---------------------
Xhat: 804
Yhat: 580
---------------------
Xhat: 802
Yhat: 581
---------------------
Xhat: 802
Yhat: 580
---------------------
Xhat: 803
Yhat: 583
---------------------
Xhat: 800
Yhat: 578
---------------------
Xhat: 804
Yhat: 581
---------------------
Xhat: 801
Yhat: 579
---------------------
Xhat: 799
Yhat: 580
---------------------
Xhat: 805
Yhat: 578
---------------------
Xhat: 803
Yhat: 577
---------------------
Xhat: 798
Yhat: 577
---------------------
Xhat: 807
Yhat: 581
---------------------
Xhat: 806
Yhat: 578
---------------------
Xhat: 799
Yhat: 578
---------------------
Xhat: 803
Yhat: 578
---------------------
Xhat: 808
Yhat: 581
---------------------
Xhat: 806
Yhat: 579
---------------------
Xhat: 807
Yhat: 580
---------------------
Xhat: 804
Yhat: 579
---------------------
Xhat: 807
Yhat: 580
---------------------
Xhat: 806
Yhat: 580
---------------------
Xhat: 806
Yhat: 577
---------------------
Xhat: 803
Yhat: 580
---------------------
Xhat: 805
Yhat: 577
---------------------
Xhat: 802
Yhat: 581
---------------------
Xhat: 802
Yhat: 576
---------------------
Xhat: 803
Yhat: 581
---------------------
Xhat: 809
Yhat: 578
---------------------
Xhat: 806
Yhat: 575
---------------------
Xhat: 807
Yhat: 580
---------------------
Xhat: 805
Yhat: 580
---------------------
Xhat: 809
Yhat: 577
---------------------
Xhat: 809
Yhat: 575
---------------------
Xhat: 805
Yhat: 574
---------------------
Xhat: 802
Yhat: 578
---------------------
Xhat: 803
Yhat: 575
---------------------
Xhat: 801
Yhat: 576
---------------------
Xhat: 807
Yhat: 574
---------------------
Xhat: 803
Yhat: 578
---------------------
Xhat: 807
Yhat: 573
---------------------
Xhat: 805
Yhat: 577
---------------------
Xhat: 802
Yhat: 575
---------------------
Xhat: 806
Yhat: 578
---------------------
Xhat: 803
Yhat: 577
---------------------
Xhat: 800
Yhat: 573
---------------------
Xhat: 804
Yhat: 571
---------------------
Xhat: 805
Yhat: 574
---------------------
Xhat: 801
Yhat: 571
---------------------
Xhat: 802
Yhat: 571
---------------------
Xhat: 808
Yhat: 574
---------------------
Xhat: 803
Yhat: 573
---------------------
Xhat: 807
Yhat: 572
---------------------
Xhat: 802
Yhat: 573
---------------------
Xhat: 801
Yhat: 575
---------------------
Xhat: 805
Yhat: 573
---------------------
Xhat: 806
Yhat: 574
---------------------
Xhat: 803
Yhat: 569
---------------------
Xhat: 807
Yhat: 571
---------------------
Xhat: 692
Yhat: 549
---------------------
Xhat: 558
Yhat: 490
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 556
Yhat: 493
---------------------
Xhat: 557
Yhat: 496
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 556
Yhat: 493
---------------------
Xhat: 551
Yhat: 498
---------------------
Xhat: 556
Yhat: 495
---------------------
Xhat: 556
Yhat: 492
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 556
Yhat: 498
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 556
Yhat: 493
---------------------
Xhat: 557
Yhat: 495
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 558
Yhat: 493
---------------------
Xhat: 541
Yhat: 494
---------------------
Xhat: 551
Yhat: 481
---------------------
Xhat: 553
Yhat: 482
---------------------
Xhat: 556
Yhat: 493
---------------------
Xhat: 555
Yhat: 495
---------------------
Xhat: 553
Yhat: 491
---------------------
Xhat: 558
Yhat: 468
---------------------
Xhat: 552
Yhat: 361
---------------------
Xhat: 552
Yhat: 200
---------------------
Xhat: 551
Yhat: 198
---------------------
Xhat: 555
Yhat: 200
---------------------
Xhat: 552
Yhat: 199
---------------------
Xhat: 550
Yhat: 198
---------------------
Xhat: 555
Yhat: 198
---------------------
Xhat: 553
Yhat: 199
---------------------
Xhat: 545
Yhat: 201
---------------------
Xhat: 545
Yhat: 199
---------------------
Xhat: 546
Yhat: 199
---------------------
Xhat: 542
Yhat: 199
---------------------
Xhat: 545
Yhat: 200
---------------------
Xhat: 537
Yhat: 199
---------------------
Xhat: 541
Yhat: 200
---------------------
Xhat: 533
Yhat: 200
---------------------
Xhat: 544
Yhat: 201
---------------------
Xhat: 537
Yhat: 199
---------------------
Xhat: 541
Yhat: 198
---------------------
Xhat: 545
Yhat: 199
---------------------
Xhat: 545
Yhat: 200
---------------------
Xhat: 541
Yhat: 200
---------------------
Xhat: 535
Yhat: 200
---------------------
Xhat: 543
Yhat: 200
---------------------
Xhat: 544
Yhat: 199
---------------------
Xhat: 543
Yhat: 199
---------------------
Xhat: 542
Yhat: 200
---------------------
Xhat: 545
Yhat: 201
---------------------
Xhat: 542
Yhat: 200
---------------------
Xhat: 542
Yhat: 199
---------------------
Xhat: 539
Yhat: 199
---------------------
Xhat: 542
Yhat: 201
---------------------
Xhat: 544
Yhat: 201
---------------------
Xhat: 542
Yhat: 200
---------------------
Xhat: 547
Yhat: 202
---------------------
Xhat: 535
Yhat: 200
---------------------
Xhat: 547
Yhat: 198
---------------------
Xhat: 540
Yhat: 201
---------------------
Xhat: 542
Yhat: 202
---------------------
Xhat: 541
Yhat: 199
---------------------
Xhat: 542
Yhat: 199
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 535
Yhat: 200
---------------------
Xhat: 535
Yhat: 198
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 539
Yhat: 200
---------------------
Xhat: 543
Yhat: 200
---------------------
Xhat: 542
Yhat: 201
---------------------
Xhat: 546
Yhat: 202
---------------------
Xhat: 546
Yhat: 199
---------------------
Xhat: 535
Yhat: 200
---------------------
Xhat: 532
Yhat: 200
---------------------
Xhat: 541
Yhat: 198
---------------------
Xhat: 541
Yhat: 202
---------------------
Xhat: 537
Yhat: 200
---------------------
Xhat: 536
Yhat: 200
---------------------
Xhat: 535
Yhat: 200
---------------------
Xhat: 545
Yhat: 203
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 544
Yhat: 203
---------------------
Xhat: 539
Yhat: 199
---------------------
Xhat: 538
Yhat: 199
---------------------
Xhat: 547
Yhat: 199
---------------------
Xhat: 538
Yhat: 200
---------------------
Xhat: 536
Yhat: 200
---------------------
Xhat: 537
Yhat: 199
---------------------
Xhat: 544
Yhat: 201
---------------------
Xhat: 540
Yhat: 201
---------------------
Xhat: 541
Yhat: 199
---------------------
Xhat: 544
Yhat: 201
---------------------
Xhat: 539
Yhat: 199
---------------------
Xhat: 546
Yhat: 201
---------------------
Xhat: 542
Yhat: 200
---------------------
Xhat: 546
Yhat: 200
---------------------
Xhat: 537
Yhat: 201
---------------------
Xhat: 537
Yhat: 200
---------------------
Xhat: 544
Yhat: 200
---------------------
Xhat: 540
Yhat: 201
---------------------
Xhat: 540
Yhat: 201
---------------------
Xhat: 542
Yhat: 198
---------------------
Xhat: 543
Yhat: 200
---------------------
Xhat: 547
Yhat: 199
---------------------
Xhat: 543
Yhat: 203
---------------------
Xhat: 541
Yhat: 201
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 536
Yhat: 202
---------------------
Xhat: 537
Yhat: 199
---------------------
Xhat: 545
Yhat: 199
---------------------
Xhat: 536
Yhat: 200
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 543
Yhat: 201
---------------------
Xhat: 546
Yhat: 215
---------------------
Xhat: 542
Yhat: 491
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 548
Yhat: 496
---------------------
Xhat: 548
Yhat: 495
---------------------
Xhat: 548
Yhat: 495
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 547
Yhat: 496
---------------------
Xhat: 548
Yhat: 494
---------------------
Xhat: 547
Yhat: 491
---------------------
Xhat: 547
Yhat: 494
---------------------
Xhat: 548
Yhat: 488
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 544
Yhat: 496
---------------------
Xhat: 550
Yhat: 500
---------------------
Xhat: 548
Yhat: 499
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 547
Yhat: 495
---------------------
Xhat: 557
Yhat: 496
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 555
Yhat: 498
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 563
Yhat: 552
---------------------
Xhat: 535
Yhat: 706
---------------------
Xhat: 531
Yhat: 743
---------------------
Xhat: 526
Yhat: 747
---------------------
Xhat: 531
Yhat: 746
---------------------
Xhat: 530
Yhat: 749
---------------------
Xhat: 538
Yhat: 750
---------------------
Xhat: 573
Yhat: 746
---------------------
Xhat: 575
Yhat: 744
---------------------
Xhat: 578
Yhat: 747
---------------------
Xhat: 577
Yhat: 745
---------------------
Xhat: 577
Yhat: 747
---------------------
Xhat: 581
Yhat: 747
---------------------
Xhat: 585
Yhat: 750
---------------------
Xhat: 583
Yhat: 746
---------------------
Xhat: 582
Yhat: 745
---------------------
Xhat: 585
Yhat: 744
---------------------
Xhat: 588
Yhat: 749
---------------------
Xhat: 582
Yhat: 748
---------------------
Xhat: 580
Yhat: 745
---------------------
Xhat: 580
Yhat: 748
---------------------
Xhat: 583
Yhat: 748
---------------------
Xhat: 579
Yhat: 746
---------------------
Xhat: 579
Yhat: 745
---------------------
Xhat: 584
Yhat: 749
---------------------
Xhat: 581
Yhat: 745
---------------------
Xhat: 578
Yhat: 746
---------------------
Xhat: 577
Yhat: 747
---------------------
Xhat: 587
Yhat: 744
---------------------
Xhat: 579
Yhat: 744
---------------------
Xhat: 582
Yhat: 749
---------------------
Xhat: 580
Yhat: 747
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 583
Yhat: 745
---------------------
Xhat: 579
Yhat: 748
---------------------
Xhat: 578
Yhat: 747
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 576
Yhat: 749
---------------------
Xhat: 581
Yhat: 748
---------------------
Xhat: 580
Yhat: 745
---------------------
Xhat: 579
Yhat: 748
---------------------
Xhat: 581
Yhat: 743
---------------------
Xhat: 582
Yhat: 750
---------------------
Xhat: 581
Yhat: 747
---------------------
Xhat: 578
Yhat: 745
---------------------
Xhat: 580
Yhat: 744
---------------------
Xhat: 578
Yhat: 743
---------------------
Xhat: 579
Yhat: 747
---------------------
Xhat: 580
Yhat: 749
---------------------
Xhat: 578
Yhat: 747
---------------------
Xhat: 576
Yhat: 748
---------------------
Xhat: 578
Yhat: 744
---------------------
Xhat: 581
Yhat: 747
---------------------
Xhat: 578
Yhat: 749
---------------------
Xhat: 580
Yhat: 745
---------------------
Xhat: 580
Yhat: 747
---------------------
Xhat: 578
Yhat: 746
---------------------
Xhat: 577
Yhat: 748
---------------------
Xhat: 578
Yhat: 746
---------------------
Xhat: 575
Yhat: 749
---------------------
Xhat: 580
Yhat: 746
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 576
Yhat: 749
---------------------
Xhat: 576
Yhat: 749
---------------------
Xhat: 578
Yhat: 748
---------------------
Xhat: 580
Yhat: 746
---------------------
Xhat: 578
Yhat: 744
---------------------
Xhat: 577
Yhat: 745
---------------------
Xhat: 577
Yhat: 745
---------------------
Xhat: 577
Yhat: 748
---------------------
Xhat: 578
Yhat: 749
---------------------
Xhat: 583
Yhat: 747
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 583
Yhat: 746
---------------------
Xhat: 577
Yhat: 746
---------------------
Xhat: 581
Yhat: 749
---------------------
Xhat: 581
Yhat: 745
---------------------
Xhat: 579
Yhat: 749
---------------------
Xhat: 580
Yhat: 746
---------------------
Xhat: 581
Yhat: 750
---------------------
Xhat: 582
Yhat: 747
---------------------
Xhat: 576
Yhat: 749
---------------------
Xhat: 576
Yhat: 748
---------------------
Xhat: 578
Yhat: 747
---------------------
Xhat: 583
Yhat: 749
---------------------
Xhat: 579
Yhat: 748
---------------------
Xhat: 581
Yhat: 750
---------------------
Xhat: 578
Yhat: 748
---------------------
Xhat: 577
Yhat: 746
---------------------
Xhat: 580
Yhat: 745
---------------------
Xhat: 577
Yhat: 748
---------------------
Xhat: 581
Yhat: 747
---------------------
Xhat: 577
Yhat: 747
---------------------
Xhat: 578
Yhat: 748
---------------------
Xhat: 580
Yhat: 744
---------------------
Xhat: 579
Yhat: 748
---------------------
Xhat: 589
Yhat: 745
---------------------
Xhat: 565
Yhat: 695
---------------------
Xhat: 548
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 554
Yhat: 490
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 554
Yhat: 489
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 554
Yhat: 489
---------------------
Xhat: 550
Yhat: 492
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 554
Yhat: 492
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 551
Yhat: 489
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 549
Yhat: 489
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 552
Yhat: 491
---------------------
Xhat: 554
Yhat: 492
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 553
Yhat: 492
---------------------
Xhat: 555
Yhat: 495
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 552
Yhat: 497
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 551
Yhat: 491
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 555
Yhat: 489
---------------------
Xhat: 553
Yhat: 491
---------------------
Xhat: 551
Yhat: 490
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 555
Yhat: 496
---------------------
Xhat: 553
Yhat: 497
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 550
Yhat: 492
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 550
Yhat: 492
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 554
Yhat: 491
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 554
Yhat: 492
---------------------
Xhat: 555
Yhat: 496
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 550
Yhat: 497
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 549
Yhat: 497
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 552
Yhat: 492
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 549
Yhat: 490
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 549
Yhat: 492
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 549
Yhat: 490
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 554
Yhat: 492
---------------------
Xhat: 550
Yhat: 493
---------------------
Xhat: 551
Yhat: 491
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 552
Yhat: 490
---------------------
Xhat: 554
Yhat: 493
---------------------
Xhat: 554
Yhat: 497
---------------------
Xhat: 554
Yhat: 489
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 549
Yhat: 489
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 552
Yhat: 497
---------------------
Xhat: 554
Yhat: 495
---------------------
Xhat: 555
Yhat: 494
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 553
Yhat: 490
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 548
Yhat: 492
---------------------
Xhat: 553
Yhat: 495
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 551
Yhat: 495
---------------------
Xhat: 553
Yhat: 496
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 556
Yhat: 496
---------------------
Xhat: 553
Yhat: 492
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 555
Yhat: 492
---------------------
Xhat: 551
Yhat: 496
---------------------
Xhat: 551
Yhat: 497
---------------------
Xhat: 550
Yhat: 494
---------------------
Xhat: 549
Yhat: 493
---------------------
Xhat: 551
Yhat: 493
---------------------
Xhat: 551
Yhat: 490
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 549
Yhat: 491
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 549
Yhat: 489
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 553
Yhat: 498
---------------------
Xhat: 552
Yhat: 489
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 553
Yhat: 494
---------------------
Xhat: 552
Yhat: 493
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 555
Yhat: 495
---------------------
Xhat: 552
Yhat: 496
---------------------
Xhat: 554
Yhat: 494
---------------------
Xhat: 549
Yhat: 494
---------------------
Xhat: 553
Yhat: 493
---------------------
Xhat: 550
Yhat: 496
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 555
Yhat: 493
---------------------
Xhat: 554
Yhat: 496
---------------------
Xhat: 555
Yhat: 496
---------------------
Xhat: 552
Yhat: 495
---------------------
Xhat: 551
Yhat: 490
---------------------
Xhat: 551
Yhat: 492
---------------------
Xhat: 549
Yhat: 495
---------------------
Xhat: 551
Yhat: 491
---------------------
Xhat: 550
Yhat: 495
---------------------
Xhat: 554
Yhat: 490
---------------------
Xhat: 552
Yhat: 494
---------------------
Xhat: 551
Yhat: 494
---------------------
Xhat: 549
Yhat: 496
---------------------
Xhat: 552
Yhat: 494
---------------------
Could you get the values from the stick when it is working after you have reconnected the wires ?
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
//PINS
#define STICK_X 0
#define STICK_Y 1
#define HAT_X 2
#define HAT_Y 3
#define HAT2_X 4
#define HAT2_Y 5
//Buttons
#define HAT2_UP 9
#define HAT2_RIGHT 10
#define HAT2_DOWN 11
#define HAT2_LEFT 12
#define OVERVAL 0
int Xstick;
int Ystick;
int Xhat;
int Yhat;
int Xhat2;
int Yhat2;
const int center = 512;
const int hatThreshold = 128;
int Temp;
int myPins[] = {0, 1, 2, 3, 4, 5, 6, 7};
boolean buttonState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
boolean oState[] = {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true};
void setup()
{
for (int i = 0 ; i < 8 ; i++)
{
pinMode(myPins[i], INPUT_PULLUP);
}
//Serial.begin(9600);
//Serial.println("Joystick ready");
Joystick.useManualSend(true);
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
for (int i = 0 ; i < 8 ; i++)
{
buttonState[i] = digitalRead(myPins[i]); //read physical pin to corresponding buttonState
if(buttonState[i] != oState[i]) // check against previous button state, if changed do something
{
Joystick.button(i + 1, !buttonState[i]);
oState[i] = buttonState[i]; // save state to compare next time
}
}
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
//HAT2
Xhat2 = analogRead(HAT2_X);
Yhat2 = analogRead(HAT2_Y);
if(Xhat2 <= center + hatThreshold &&
Xhat2 >= center - hatThreshold &&
Yhat2 <= center + hatThreshold &&
Yhat2 >= center - hatThreshold)
hatWithButtons(-1);
else
{
if(Yhat2 >= center + hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(45);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(315);
else
hatWithButtons(0);
}
else if(Yhat2 <= center - hatThreshold){
if(Xhat2 >= center + hatThreshold)
hatWithButtons(135);
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(225);
else
hatWithButtons(180);
}
else if(Xhat2 <= center - hatThreshold)
hatWithButtons(270);
else
hatWithButtons(90);
}
// Update joystick state
Joystick.send_now();
}
void hatWithButtons(int val){
switch(val){
case -1:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 0:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 45:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 90:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 0);
break;
case 135:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 1);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 180:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 0);
break;
case 225:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 1);
Joystick.button(HAT2_LEFT, 1);
break;
case 270:
Joystick.button(HAT2_UP, 0);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
case 315:
Joystick.button(HAT2_UP, 1);
Joystick.button(HAT2_RIGHT, 0);
Joystick.button(HAT2_DOWN, 0);
Joystick.button(HAT2_LEFT, 1);
break;
}
}
void loop()
{
// X axis computations
Xstick = map(analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
// Y axis computations
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
Ystick = constrain(Ystick, 0, 1023);
Joystick.Y(Ystick);
void loop()
{
// X axis computations
Xstick = map(1023-analogRead(STICK_X), OVERVAL, 1024 - OVERVAL, 0, 1023);
Xstick = constrain(Xstick, 0, 1023);
Joystick.X(Xstick);
Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
->Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 0, 1023);
Yes, that works. Or by changing whats already there, like this:Code: [Select]Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 1023, 0);
->Code: [Select]Ystick = map(analogRead(STICK_Y), OVERVAL, 1024 - OVERVAL, 0, 1023);
You can read more about map from here:
https://www.arduino.cc/en/Reference/Map
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
#include <math.h> // atan2, M_PI, square, sqrt
//HAT
Xhat = analogRead(HAT_X);
Yhat = analogRead(HAT_Y);
int HAT_ZERO = -1;
int hat_angle[] = {0,45,90,135,180,225,270,315};
//// HELPERS
// like Arduino's `map`, but with doubles instead of longs
double dmap(double x,double in_min,double in_max,double out_min,double out_max)
{
return (x-in_min)*(out_max-out_min)/(in_max-in_min)+out_min;
}
bool close_enough(int actual,int ideal,int arc)
{
// smaller value results in narrower valid angles (requires more accuracy)
// must be less than or equal to 22, or coords will overlap
arc = constrain(arc,1,22)/2; // half an arc in each direction
int ub = ideal+arc; // upper bound
int lb = (ideal?ideal:360)-arc; // lower bound
return (ideal?(lb<actual&&actual<ub):(lb<actual||actual<ub));
}
//// JOYSTICK
// x and y coordinates to Joystick degrees
//
// Usage:
// Joystick.hat(xy_to_joy(Xhat,Yhat));
// Joystick.hat(xy_to_joy(Xhat,Yhat,true)); // invert y axis
int xy_to_joy(int x,int y,bool inv_y=false)
{
// normalize coordinates
double mx = dmap((double)x,0,1023,-1.0,1.0);
double my = dmap((double)y,0,1023,(inv_y?1.0:-1.0),(inv_y?-1.0:1.0));
// convert rectangular to polar coordinates
double r = sqrt(square(mx)+square(my));
double radius_keepout = 0.125;
if (r < radius_keepout) {
// Previously, hatThreshold was set to 128, which is about 1/8 of 1023,
// so I tried to keep the same relative amount.
return HAT_ZERO; // inside of "radius dead zone"
} else {
// return nearest hat degrees
int degrees = int(M_PI/180*(M_PI+atan2(my,mx)));
for (int i=0;i<8;++i) {
int arc_width = 40;
// arc_width 40 gives dead zones 5 degrees wide at:
// 22.5 67.5 112.5 157.5 202.5 247.5 292.5 337.5
if (close_enough(degrees,hat_angle[i],arc_width)) {
return hat_angle[i];
}
}
return HAT_ZERO; // inside of "angle dead zone"
}
}
YHat = 1024 - analogRead(HAT_Y);
arc = constrain(arc,1,45)/2; // half an arc in each direction
// ^^ 1/8 of a circle in degrees, corresponding to 8 "hat" angles.
The hatThreshold constant is the null zone for the hat. Anything inside a square of 2x hatThreshold size, centered around "center", is considered NULL.
Maybe you could try to compute the linear distance between the center and your position, instead of comparing toward axis position.
ok, so i just need to make the 128 bigger and test for the desired nullzone :thumb:
the way it's coded is with a square nullzone? i didn't realize that. square is actually ideal for digital use because of how it minimizes the chance of inadvertent keypresses due to imperfect movement.
Yhat = 1024 - analogRead(HAT_Y);
//HAT
Xhat = analogRead(HAT_X);
Yhat = 1024 - analogRead(HAT_Y);
if(Xhat <= center + hatThreshold &&
Xhat >= center - hatThreshold &&
Yhat <= center + hatThreshold &&
Yhat >= center - hatThreshold)
Joystick.hat(-1);
else
{
if(Yhat >= center + hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(45);
else if(Xhat <= center - hatThreshold)
Joystick.hat(315);
else
Joystick.hat(0);
}
else if(Yhat <= center - hatThreshold){
if(Xhat >= center + hatThreshold)
Joystick.hat(135);
else if(Xhat <= center - hatThreshold)
Joystick.hat(225);
else
Joystick.hat(180);
}
else if(Xhat <= center - hatThreshold)
Joystick.hat(270);
else
Joystick.hat(90);
}
const int hatThreshold = 128;
so I may have to use the PS2 stick.
Looking good, the slight height increase should help you not press the nearer stick by mistake. I laughed at your insurance estimate but thinking about it it's probably fair - it is one of a kind and has taken countless hours to refine.
If you want ideas for a case some dimensions would be good, it looks much thicker than I was imagining it would be...
I have recently sent a message to W11cE asking if he by chance knows what the pinouts are for this particular PS Vita 2000 analog stick that has fewer pins than the original PS Vita analog stick. Just 4 instead of however many, I guess six, on the original.It's different from PS Vita 1000, see:
There's speculation here (http://modretro.com/xen/index.php?threads/ps-vita-psp-go-analog-stick-pinout.13568/) that [empty] should be a second GND and it is pictured as going into the stick so should probably be something...
Using W11cE's pic this is the order, assuming your connector is pictured with the stick bent to the left at the top of the cable. I'm also assuming it's 5v but if you're running the others on 3.3v go with that.Show Image(https://drive.google.com/uc?id=0B_0MQrj9_eGtRFNCc09iWjN2TFE)
1 - GND
2 - X
3 - Y
4 - 5v
5 - [empty]
6 - 5v
There's speculation here (http://modretro.com/xen/index.php?threads/ps-vita-psp-go-analog-stick-pinout.13568/) that [empty] should be a second GND and it is pictured as going into the stick so should probably be something...
Almost:
1 - GND
2 - X
3 - Y
4 - 5v
5 - 5v
6 - 5v
The small trace goes to pin 5 under the connector.
Wouldn't even say speculation. More like just a guess.
fabulous, thank you :-*
Using W11cE's pic this is the order, assuming your connector is pictured with the stick bent to the left at the top of the cable. I'm also assuming it's 5v but if you're running the others on 3.3v go with that.Show Image(https://drive.google.com/uc?id=0B_0MQrj9_eGtRFNCc09iWjN2TFE)
1 - GND
2 - X
3 - Y
4 - 5v
5 - [empty]
6 - 5v
There's speculation here (http://modretro.com/xen/index.php?threads/ps-vita-psp-go-analog-stick-pinout.13568/) that [empty] should be a second GND and it is pictured as going into the stick so should probably be something...
Almost:
1 - GND
2 - X
3 - Y
4 - 5v
5 - 5v
6 - 5v
The small trace goes to pin 5 under the connector.
Wouldn't even say speculation. More like just a guess.
I have been following this PS Vita Analog stick mod for a bit and finally tried to give it a stab but for some reason when I wire everything up all I get are random values with the Teensy LC that I'm using. Ive tried different connectors and techniques and have tried different arduino test sketches but its always the same. Any ideas??
Currently using:
1 - GND
2 - X
3 - Y
4 - 5v
5 - 5v
6 - 5v