Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited
Resolved Resolved by CardboardHacker!

Compatible Joypads With Ez-Builder

User-inserted image


Hi everyone.

I was playing around with a joypad I have (not the one in the picture) with EZ-Builder, and was trying to configure some buttons to control servos and 2 drive motors running of an L298 H-bridge. I managed to do some test control scripts for the numbered buttons, but ran in to a little trouble with the direction pads. *confused*

A managed to get the two drive motors going forwards and reverse with no problems (2 motors connected to L298 for combined speed control), but I have a HD servo that controls the steering and I couldn't find a way to configure the left/right direction pads to control the servo.

Could one of you kind souls out there advise me on how to do this, (if indeed it is possable as that part of the config screen looks greyed out and seems unchangable), and also, what control pads are fully compatable with EZ-Builder? If I can get the drive/steering set up mentioned above working okay, I will get another joypad with more buttons and controls (like the one pictured above) to control the numerous servos I have installed in my bot.

As always, any help and advice would be great fully received.

Steve. :)

AI Support Bot
Related Content
Synthiam
#1  
If I understand correctly, your direction pad will fall under one of these variable sets:

User-inserted image


To use these, make a script which detects the variable which is triggered and have the servo move that direction. More info to come.
#2  
This is the script you'll need. Follow the instructions!

Code:

#Run this script and start pressing the directional pad. If the servo 
#doesn't move, Follow the instructions below.

#Change the JoystickX3 to the other variables in the joystick control
#until you find the one that causes the servo to turn.


#Change turning servo port to your configuration
$turnservo = d9

#set the left turn position of your servo
$leftturn = 9

#Set the Right turn position of your turn servo
$rightturn = 171

#Set the value for left on directional pad(default not correct)
$joystickleft = 10

#Set the value of right on the directional pad(default not correct)
$joystickright = 20


:loop

#Left
If ($JoystickX3 = $joystickleft)
Servo($turnservo, $leftturn)

#Right
ElseIF ($JoystickX3 = $joystickleft)
Servo($turnservo, $rightturn)
EndIF

Goto(loop)
United Kingdom
#3  
@technopro.

Thank you for your reply. I will give the script a try a little later. Also, I just want to see if I understand it correctly, the "vairables" screen can change the values of "joystick 1". Is that right, or am I way off?

Also, I forgot to ask this in my first post, the left and right finger trigger buttons on the top of the joypad (seen below), where can they be configured. Is it under buttons?

User-inserted image


Cheers,
Steve.
PRO
Synthiam
#4  
If you can press them, then they are buttons. You can hover your cursor over any blue question marks for Help in ARC. The question marks identify anything you can hover over for help. For example, if you hover over the blue question mark in the Buttons tab of the Joystick, you will be able to read it. Once you have read it, it will state that you can press the buttons on the joystick to see which buttons are for what code.

Pressing the button will highlight the row. Only buttons can be pressed, it won't highlight if you move the joystick part. The joystick and D Pad are not "buttons".

What you highlighted are buttons.

The blue help icons are everywhere in ARC. Move the mouse cursor and hover over the blue help icons. When you do that, a popup will display help about that object.
#5  
@Steve... All the buttons and joysticks are configured within the control.... Go to the tab on the top that says buttons.... You will see the list of joystick buttons and cmds you can configure when you push or release a button... As DJ stated in his above post... The ?'s throughout ARC will provide you with lots of additional valuable information... You will also notice when you push a button while configuring, the actual line will be highlighted in blue (so you know what line is associated with what button).... You can now edit scripts behind these lines so as to do what you want when a button is pushed/released...
United Kingdom
#6  
@DJ and Richard.

Thanks for your replies and appreciate your response. I know about the "?" Help icons and have been using them all over the site along with the learn section, but for this instance I have not seen anything light up when I press the trigger buttons on the button list which is why I am asking about joypad comparability here.

On the subject of the D Pad controls, I know that they don't count as buttons, and what I was asking was if I can control the H-bridge motors for forwards and reverse, and configure the left/right controls to control a servo other to what @technopro has mentioned. I haven't seen any mention about configuring a joypad/stick this in the "?" Help pop ups to help me with this specific set up which again is why I am asking for help in the forum.
#7  
By default the left joystick should drive the Movement Panel as soon as you add the joystick control to your project... If it doesn't then the joystick isn't working (which means the button lines will not be highlighted in blue), not connected or is incompatible.... In the dropdown box of the joystick control should be the joystick that you are using (if it is connected and working that is)... If nothing is there then ARC does not see the joystick that you have attached to your PC....
PRO
Synthiam
#8  
You will need to have the Joystick selected before you can press the buttons to see the highlighted rows for each button.

1) Load ARC

2) Project -> Add Control from top menu

3) Select Misc Tab

4) Add Joystick

5) Select your joystick from the drop down in the Joystick Control

6) Press the GEAR on the Joystick control

7) Select the tab BUTTONS within the config window for the joystick control

8) you will see a blue ? button that you can put your cursor over. There is where you add the code for each button. You can press the button on the joystick to see which row highlights
United Kingdom
#9  
@DJ

Thanks again for the reply. I have selected the joypad as you mentioned, and have the numbered buttons (1 to 6) configured and working with servos, as well as the D Pad controlling the forward and reverse controls, but never managed to get the trigger buttons or acceleration stepper button working and have never seen them highlighted, but I will try what you suggested in step 8 of you post later today.

@Richard.

I have tested the control with a game and all the buttons work (with the exception of the acceleration Stepper button. The 4 LED's light up but it didn't seem to do anything) and have checked to see if it is properly connected, which I have confirmed that it is. So unless I can get what DJ mentioned above working, then as you say, it could be a comparability issue. *stress*
United Kingdom
#10  
A quick update.

I had unexpectedly been in hospital for a few days and got home a couple of days ago, so I have been unable to give any updates until now.

Anyway, I spent yesterday writing a few scripts and also tried the joypad out again. In regards to the trigger button issue I had, I started a new project and did everything else exactly how I did it before (I assure you) to set the control pad up, with one exception, I downloaded the ARC 2014.10.18.00 release that was available. Hey presto, the trigger buttons now highlight in the "buttons" list and can be used. So whatever was causing the glitch has corrected itself. :)

@technopro.

Thanks again for the code and instructions you supplied in your post. I now have everything working the way I like now, and your help, as well as Richard and DJ, is appreciated. :D

I am going to purchase another control as I need more buttons to cover all the other servos I have installed on my bot, so I would love to know what anyone would recommend that would be compatable with ARC (Preferably a wireless controller).

Thanks,
Steve.

(Ps. Apologies if my tone in post #7 seemed a little off. I was not having a great day, hence the trip to the hospital soon after. I like to problem solve things myself, and if I do get stuck I will always look through the forums and help sections first as well as tutorials, before I ever ask for help here. But it's nice to know you guys are around and willing to help the way you do which is great. All this is still quite new to me, but thanks to you guys, I am learning all the time. Great product, great site, and great community. Thanks.;) )
#11  
hi any one that have a moga pro controller working in ARC ?
PRO
Synthiam
#12  
If it is made to be used on a PC, then it will work. Without a link to your joystick, it's impossible to answer:)