Asked — Edited
Resolved Resolved by Niek!

Connecting An Analog To Ez-B To Control Robot

is it possible to put an analog stick to an ez-b through the A0,A1...... ports

User-inserted image

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:

$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.


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

Netherlands
#9  

@kplamondon with other board, I mean the rest of your ps2 controller. Could you trace what AD is going to on there?

#10  

Visuals are always nice so heres a bunch of pictures, the AD goes to the middle wire on the R1 and R2 (L1 and L2) buttons, the wiring there is R1, JP4, R2 it also goes through all the buttons on the Left and all the Button on the Right. Whatever AD is it goes to every button and potentiometre, either 5v or GND but i am still unsure but it does connect to all the buttons and maybe R23 i am unsure.

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

Netherlands
#12  

I think I have an idea how to connect them up to the EZ-B. Could you measure the resistance between the outer terminals in 3 positions? All the way to one side, to the other and centered.

#13  

sorry about not replying have been gone for the past 3 days, i will measure this tomorrow. But how specifically do you want to measure the resistance, send power and use a volts metre or measure ohms? I am not totally sure what you mean, if you can be more specific on the connections i should be able to measure some connections.

Netherlands
#14  

Just hook up a multimeter to the outer two leads, set it to measure ohms and measure the resistance when the potmeter is to one side, to the other and centered. This helps me determine how to hook it up to the EZ-B, if you should use external pullups/downs etc.

#15  

Ok i measured the ohms resistance, although the numbers were jumping around the more i tested, under ohms 2000 the values were: centre 65, down 90, up 41. They changed a bit do to trying to put the ends of the multimetre on soldered ends but i am sure the differance between the values would be similar. A few times i measured centre around 55-65 but my last was 65.

Edit:

Up = 800 resistor Centre = 1.3K resistor Down = 1.8K Resistor

#16  

also i found a blog where someone used the same controller as me and was able to use the joystick board that the joysticks are on. check it out pg I, pg II, pg III.

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.