I have some questions? I'm very new to this adn trying to build and controller

Hi, I'm very new to arduino and coding. My goal is to make a controller with a ps2 joystick and 10 buttons on a uno. Now i have a issue with uploading code from the library. I can only upload one at a time and it will be just joystick or one button at a time?... Feedback is much appreactiated!

Hi, welcome to the Arduino world.
Can you show your sketch ? Please put the sketch between code-tags. The </> button is for code-tags.

Do you want an existing PS2 Controller connect to a computer with USB and use an Arduino for that ?
Or do you want to make your own PS2 Controller ?

Does a PS2 Controller have a large connector ? Do you know the signals of that connector ?

project_vicinity:
Hi, I'm very new to arduino and coding. My goal is to make a controller with a ps2 joystick and 10 buttons on a uno. Now i have a issue with uploading code from the library. I can only upload one at a time and it will be just joystick or one button at a time?... Feedback is much appreactiated!

An Arduino can only contain one program. If you want it to do several different things you need a more complex program that does them all. Often people make such a program by combining two others that they know work.

If you want help with that it would be useful to say a bit more about your project. O.k. it has a joystick and 10 buttons but I have no idea what it's supposed to be controlling or what the buttons might be for.

Steve

yes im sorry! i should of included more information. It will be a gaming controller on pc, wired also. basicly i want the arduino to repicate a keyboard. joystick is for movement and buttons for hot keys. ive tried combining codes for buttons and joystick but when verified its getting error messages for lines. Im not very good at coding and just looking for some advice.

The Arduino Leonardo / Micro / Pro Micro boards can behave as a keyboard or mouse (or any other USB device). Also the SAMD boards can do that.
See: Keyboard and Mouse libraries.
If you want more, then there is the NicoHood HID library.

We can probably help you to get your combined code working. But not if we can't see it!

Please post your best attempt and the error listing that you get.

Steve

i honestly dont have it anymore i had erased it because it wouldnt verify. but what it was was joystick code from arduino website and button code from the website and i tried using a example off of the web to combine them

it was not correct and looking for examples of how to do it

joystick code i used

[color=#00979c]const[/color] [color=#00979c]int[/color] [color=#000000]xPin[/color] [color=#434f54]=[/color] [color=#000000]A0[/color][color=#000000];[/color] [color=#434f54]//X attach to A0[/color]
[color=#00979c]const[/color] [color=#00979c]int[/color] [color=#000000]yPin[/color] [color=#434f54]=[/color] [color=#000000]A1[/color][color=#000000];[/color] [color=#434f54]//Y attach to A1[/color]
[color=#00979c]const[/color] [color=#00979c]int[/color] [color=#000000]swPin[/color] [color=#434f54]=[/color] [color=#000000]2[/color][color=#000000];[/color] [color=#434f54]//Bt attach to digital 8[/color]
[color=#00979c]void[/color] [color=#5e6d03]setup[/color][color=#000000]([/color][color=#000000])[/color]
[color=#000000]{[/color]
  [color=#d35400]pinMode[/color][color=#000000]([/color][color=#000000]swPin[/color][color=#434f54],[/color][color=#00979c]INPUT[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//set btpin as INPUT [/color]
  [color=#d35400]digitalWrite[/color][color=#000000]([/color][color=#000000]swPin[/color][color=#434f54],[/color] [color=#00979c]HIGH[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//and HIGH[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]begin[/color][color=#000000]([/color][color=#000000]9600[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//initialize serial monitor[/color]
[color=#000000]}[/color]
[color=#00979c]void[/color] [color=#5e6d03]loop[/color][color=#000000]([/color][color=#000000])[/color]
[color=#000000]{[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#005c5f]"X: "[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//print "X: "[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#d35400]analogRead[/color][color=#000000]([/color][color=#000000]xPin[/color][color=#000000])[/color][color=#434f54],[/color][color=#00979c]DEC[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//read the value of A0 and print it in decimal[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#005c5f]"|Y: "[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//print "|Y: "[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#d35400]analogRead[/color][color=#000000]([/color][color=#000000]yPin[/color][color=#000000])[/color][color=#434f54],[/color][color=#00979c]DEC[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//read the value of A1 and print it in decimal[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#005c5f]"|Z: "[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//print "|Z: "[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]println[/color][color=#000000]([/color][color=#d35400]digitalRead[/color][color=#000000]([/color][color=#000000]swPin[/color][color=#000000])[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//read the value of pin8 and print it[/color]
  [color=#d35400]delay[/color][color=#000000]([/color][color=#000000]500[/color][color=#000000])[/color][color=#000000];[/color] [color=#434f54]//delay 500ms[/color]
[color=#000000]}

and button code 

https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button#schematic[/color]

Sorry but if you can't be bothered to make the attempt then neither can I. Merging Code will give you plenty of ideas of how to go about it.

Steve

sorry im currently at work and i will see if i can pull up anything that i have from my laptop when i get home

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.