
kplamondon

is it possible to put an analog stick to an ez-b through the A0,A1...... ports
By setting up variables to the x,y and button press (vert, horz, sel) is it possible to setup if statements for controlling the robot ex:Code:
$Vertical = A1
$Forward = D1
While()
.get(A1)
If $Vertical = 1
$Forward = On
EndIf
sorry code is incorrect have forgotten a few of the terms, since i have been using Java and C++ for the last few months and everytime I start using other languages i need a quick recap of the other languages.
And in the other controller board, are there any resistors on the XY etc lines?
If you follow the backside of the board you will notice the 2 pins on each potentiometres are connected to eachother, these are all on the AD pins, then the third pin goes sepparately to the RX,RY,LX,LY.
The AD pin is the mystery, AD i would think would stand for an analog input or output but i am unsure.
Here is the 1st boards wiring: here
EDIT: if you mean the board with the buttons etc, their might be resitors on their that the AD is connected to
Edit:
Up = 800 resistor
Centre = 1.3K resistor
Down = 1.8K Resistor
See if you can figure out what he did, he doesn't explain much but he cut out a breadboard to fit and managed to hook it all up to that. I don't really need any of the buttons, which i can already hook those up on my own. But the analogs he was able to hook up to that board he made.
The guy you linked just created his own board with tactile switches (on/off, no in between). It's easy to hook up to the EZ-B, but takes up lots of IO.
I finished the schematic yesterday, just writing some example code for you. I can't send the schematics, but it's basically just hooking the AD up to 5V and for every RX, RY etc connect the pin to a analog port and use a 1.3K pulldown resistor. Then you can just write a sketch that constantly prints the analog values of those pins to the console to find out the positions.
As for the example code i can't wait to see, thanks alot for your help so far.
I finally had time to finish the schematic and code. Here's how you hook it up. Do the same for RX, RY etc.
The joystick's resistance is 1.3K when centered, so with the 1.3K pulldown it should divide the voltage in half. ARC's getADC function returns a value between 0 and 255 for 0-5V. This means that centered, it should be around 127. Up it should be around 158 and down 107. The value might fluctuate quite a bit so the code should have tresholds. This means you end up with something like this:
Code:
Now use this code for every axis and you should be fine
Thanks so much this will help a lot, i got lots of work to do on my own still but at least i know what to do now.
What software are you using to build schamatics, Eagle? B/c i just bought it, and i seen the video with you designing a for the EZ-B that can be programmed using Arduino (which i think is a great idea), what was that software? It didn't look like eagle, I'm knew to designing PCB's.
I am using Eagle CAD, yes. There are lots of great tutorials for it out there. The software Jeremie over at EZ-Robot is using was Altium.