Pages: [1]   Go Down
Author Topic: Real-Time data acquisition (via USB) resulting in output adjustment  (Read 1573 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.



https://github.com/billroy/bitlash-commander

-br
http://bitlash.net

Logged

Pages: [1]   Go Up
Jump to: