Go Down

Topic: Real-Time data acquisition (via USB) resulting in output adjustment (Read 3792 times) previous topic - next topic


I cannot find hot to get Arduino to send Arduino data in Real-Time and have it vary it's output accordingly. I am trying to use the analog sticks on a joystick or PS3 controller to control motors on my robot. I have MOSFETS that will control the motor speed, but they need an (analog) input (from Arduino).
I have found many articles with bad documentation on doing this wirelessly, but I need the Arduino to be wired to the computer.

How do I code for this? Reading serial(USB) data and using it to change the analog output?

I plan on using the plain Arduino Uno and there are three motors to control with the MOSFETS and one standard servo(the easy part, once I know how to get data from the serial communication).
(Also using a MacBookPro)


can you put a block diagram of what your are trying to do? I could not really understand from your description what you are trying to do and what you what are the inputs and outputs to the Arduino


I have found many articles with bad documentation on doing this wirelessly, but I need the Arduino to be wired to the computer.

It's exactly the same. Just skip the part about getting the radios configured/wired/tested/etc.

Forget the PS3 for the moment. How is the joystick connected to the Arduino? What kind of joystick is it?

How do you want the changing values to change the speed of your motors?
The art of getting good answers lies in asking good questions.


I was planning on using one or two Logitech Attack 3 joysticks plugged into my laptop and using normal usb-b cable to connect my laptop to the arduino.
What I meant was that when I push the joystick forward (increasing/decreasing the pot resistance) I want the arduino to change its analog outputs to the MOSFETS. I have done most of the example code, but I don't understand it works.

Basically: Joystick to Laptop, Laptop interprets and sends data to Arduino, Arduino adjusts pwm outputs based on how the Joystick is moved.


If a virtual joystick is acceptable, Bitlash Commander does this pretty much out of the box.  I believe you could extend it to read your joystick if the physical hardware is important.

You need a program on the PC to send commands to the Arduino, and another program on the Arduino to interpret them and set the PWM values.  Bitlash Commander handles the PC part, and send commands to Bitlash, which you install on the Arduino.



Go Up