Author Topic: Need Arduino Serial Help...  (Read 3184 times)

0 Members and 1 Guest are viewing this topic.

Offline timckiTopic starter

  • Contributor
  • Posts: 27
  • Country: us
Need Arduino Serial Help...
« on: March 19, 2016, 11:14:46 pm »
What I have  is the beginning of a robot controlled by an xbox360 controller with a usb shield....

I have 2 servos controlled with one joystick, (up, down, left, right)... I have "Serial.print"   displaying the movement in a terminal...
I have the sabertooth motor driver being controlled by serial pin 1 TX with the other joystick output.......

The pan and tilt servos work fine but the two motors are getting less than desired results....

Does the serial printing from the servos interfere with  the motor signals coming out of TX1?

I can post the code if you need to look at it but it is UGLY.....
This oscilloscope isn't telling me anything all I see is a squiggly line....
 

Offline nerd1951

  • Newbie
  • Posts: 1
  • Country: us
Re: Need Arduino Serial Help...
« Reply #1 on: March 20, 2016, 06:00:00 am »
If I understand your description, it sounds like you are trying to control the Sabertooth from the Arduino's serial port and also have a terminal connected to the same port. If this is the case then the serial print will interfere with the motor control.

Since the Arduino only has one serial port, I would use the Sabertooth in "RC Input Mode". Then you can control it from one of the PWM outputs from the Arduino. Then you could control your motors like servos. This would leave the Arduino serial port free for your terminal interface.

What would help is if you could post a list of each of the Arduion I/O pins you are using and what each is connected to.
 

Offline FreddyVictor

  • Regular Contributor
  • *
  • Posts: 164
  • Country: gb
Re: Need Arduino Serial Help...
« Reply #2 on: March 20, 2016, 04:25:17 pm »
as nerd1951 has said, yes, the debug data you're sending to the console will also be sent to the motors, so may well be causing problems.

Arduino platform does have a SoftwareSerial library which allows other pins to be used for Serial communications.
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 18111
  • Country: 00
Re: Need Arduino Serial Help...
« Reply #3 on: March 20, 2016, 09:49:52 pm »
as nerd1951 has said, yes, the debug data you're sending to the console will also be sent to the motors, so may well be causing problems.

Also every time you upload a sketch...

To avoid this you can use a Leonardo. Leonardos have two serial ports, one for talking to the PC and the other one on pins 0+1
 

Offline slashdev

  • Contributor
  • Posts: 10
Re: Need Arduino Serial Help...
« Reply #4 on: March 21, 2016, 03:55:12 am »
SoftwareSerial is very inefficient and unreliable, so I'd suggest AltSoftSerial on pins 8 & 9 as a much better alternative.  If you can't use those pins, you could try NeoSWSerial on any other pins.  It's not quite as good as AltSoftSerial, but still much better than SoftwareSerial.  It has some limitations, but it's perfect for text printing at 9600, 19200 or 38400.

Cheers,
/dev
 

Offline timckiTopic starter

  • Contributor
  • Posts: 27
  • Country: us
Re: Need Arduino Serial Help...
« Reply #5 on: March 22, 2016, 01:17:17 am »
AltSoftSerial sounds like what I am looking for just displaying button presses....

Thanks to all that have responded..
This oscilloscope isn't telling me anything all I see is a squiggly line....
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->