Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by Rich!

Uartwrite Question?

Trying to send the below code via serial to my SSC-32 servo board to test servo movement... it gives me an error because $pw is greater than 255 (max for a byte which I do understand)... It's probably me not getting it, but how do I send numbers greater than 255?

This is the error "Error on line 6: Value was either too large or too small for an unsigned byte."


$m =2500



Upgrade to ARC Pro

ARC Early Access will give you immediate updates and new features needed to unleash your robot's potential!

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
United Kingdom
Bearing in mind I've not used the UARTWrite function yet nor the SCC32 but...

Have you tried;


UARTWrite(0,1,"#0 "+$pw+" T "+$m,0x0D)

In other words, having the whole "#0 1000 T 2500" part sent in one go rather than piece by piece.

Note, I prefer to use hex for ascii characters hence the 0x0D rather than the 13 for a carriage return. 13 may work fine.

Also, are you missing the "P" so should it be


UARTWrite(0,1,"#0 P "+$pw+" T "+$m,0x0D)

or with your code


UARTWrite(0,1,"#0", "P",$pw,"T",$m,13)

Edit: I guess you edited before I finished typing and added that P in:)
United Kingdom
Suggestion #2... change

$pw = 1000


$pw = "1000"

I'll have a proper look tomorrow but I need sleep, just thought I'd throw a couple of ideas at you before I head up though (it's also an insight in to how I guess at things if I don't know.
Crap.... you're a genius Rich... this worked...



Cheers and thanks....:)
This now works....


$m ="2500"

United Kingdom

Just out of curiosity, why not use SendSerial? Not that it makes much of a difference (in fact, I don't even know what the difference would be other than the command used and it's syntax).
No reason, just got used to using the Uart commands when I was messing with my iRobot Create.... kind of a habit now... I guess I could just go back to sendserial....

Can you use the Sendserial command on Uart 0 port of V4?
You have to specify the Digital port when using the SendSerial command. Don't know which d port is associated with UART 0.
Uart 0 is the regular Uart port located on the lower right side. Not one of the digital ports.

User-inserted image
Uart 1 send is on port D5, receive is on D6.... Uart port 2 send is D18 and receive is D19... UART port 0 as Dave pointed out is the black 4 pin port on the right side of the picture he provided above...

@Dave, I don't think you can use SendSerial on UART port 0.... It doesn't seem to have a port designation (like D0 - D23) and the SendSerial command needs that as it's first parameter....
United Kingdom
You would need to use UARTWrite on UART0
"You would need to use UARTWrite on UART0"

@Rich and @RichardR, that's what I thought. I just wanted to clarify this point. When the Sendserial command was brought up a few posts back I thought I had missed something. I've been using my Kangaroo/Sabertooth board combo on UART0 and using the UART commands with much success and am very happy with it. I just always like to know if there are any other ways to do something.

On a related note (you guys probably know this); When using the UART0 port it always has to be initialized the first time you use it after power up by using the UARTInit command.

Example: UARTInit(0, 0, 9600 ).

Once initialized you don't have to send that command again till the next power up.
Dave, a few posts back I mentioned that you needed a digital port defined in order to use the SendSerial commands. I understood the question and also knew where the UART 0 connection is located since I'm using it for sending Roomba commands. The point I was attempting to make (although poorly) was that since the UART 0 ports are not identified as single Digital ports like UART 1 and UART 2 are, that the SendSerial command cannot be used.

You are also correct that the UART port only needs one Init command as long as the EZB(4) remains powered.
Thanks @Robot-Doc, I understand now. You did not do a poor job. Your advice is always welcomed and concise. ;)