Asked — Edited

Uart Port Designation

On the v4 we have 4 ports designated to UART. The command asks for a port ie. UARTInit(0,0,9600) the first is the board the second is the port and the third is the data. What do you put in the second to indicate the Tx and Rx ports on v4?


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

Canada
#1  

There are several UART command when you open/edit Script . Just do UART search under Script Help

there is also UART example available in ARC(EZ-Script Function Syntax)

You may also refer to a recent post https://synthiam.com/Community/Questions/6241

#2  

There are only three UART designations 0, 1, & 2. The firmware determines which digital port is used during a receive or transmit command.

#3  

That would be 3 UART ports... No need to designate RX and Tx ports...

Sample code on how to use them is below (using a Roomba)... using uart port 3



uartinit(0, 2, 57600) #initiate the port
sleep(20)

repeatUntil(1=2)
 uartWrite(0,2,142,7) #Check Roomba Create Bump and wheel drop sensor

sleep(20)
  
  IF (UARTAvailable(0,2)>0)
    $x=UARTRead(0,2,1)
    $x=GetByte($x)
print($x)
endif
sleep(50)
endrepeatUntil