I received my ARC32 and I must say I like it, this really is a step ahead of everthing else I have used to control servo's and the Studio software is user friendly and looks good.
I am using Studio Version 2.0.0.7 and I have read through the posts here and on Lynxmotion's forum concerning the changes to the Serial commands and I have been using this code to do some testing on a few servo's and works as expected, waits for the data then sets the servo postion and speed then toggles the status LED. I send 5000,250 + CR and I receive Pos1 = 5000, Spd1 = 250 in the terminal window.
Code:
'HW UART 1 Serial Setup
SETHSERIAL1 H9600,H8DATABITS,HNOPARITY,H1STOPBITS
Pos1 Var sWord
Spd1 Var Word
Pos1 = 0
Spd1 = 100
'Set Servos Centered
HServo [P4\0,P5\0]
Main:
HSerin 1,[sdec Pos1, dec Spd1]
HSerout 1,["Pos1 = ",sdec Pos1,", Spd1 = ",dec Spd1,13]
HServo [P4\Pos1\Spd1]
Toggle P44 'Status LED
Pause 100
GoTo Main
I then tried the HSerin with a Label and time out value and send 5000 + CR like this.
Code:
HSerin 1,nodata,5000, [sdec Pos1]
HSerout 1,["Pos1 = ",sdec Pos1,13]
HSerin 1,[dec Spd1]
HSerout 1,["Spd1 = ",dec Spd1,13]
HServo [P4\Pos1\Spd1]
nodata:
Toggle P44 'Status LED
Pause 100
I do not receive any data back so I set up the Status LED just as a visual feedback of when the data was received and tried differant time out values but the LED flash rate stays the same I thought with a larger time out value the flash rate would change as the HSerin waits longer for the data does 5000 = 5 secs?.
I also tried some testing with Serin and received some not as expected results here is some code that I was trying one section at a time.
Code:
'Sent 5000,250 + CR and receive Pos1 = 5, Spd1 = 5
Serin ComRX,ComBaud,[sdec Pos1, dec Spd1]
Serout ComTX,ComBaud,["Pos1 = ",sdec Pos1,", Spd1 = ",dec Spd1,13]
'Sent 5000 + CR and received Pos1 = 5
Serin ComRX,ComBaud,[sdec Pos1]
Serout ComTX,ComBaud,["Pos1 = ",sdec Pos1,13]
'Sent 250 + CR and received Spd1 = 2
Serin ComRX,ComBaud,[dec Spd1]
Serout ComTX,ComBaud,["Spd1 = ",dec Spd1,13]
I also tried the Serin with a Time out value and a label but received the same results as before with the HSerin time out test.
Code:
'Sent 5000 + CR No data back
Serin ComRX,ComBaud,5000,nodata,[sdec Pos1]
Serout ComTX,ComBaud,["Pos1 = ",sdec Pos1,13]
Serin ComRX,ComBaud,5000,nodata,[dec Spd1]
Serout ComTX,ComBaud,["Spd1 = ",dec Spd1,13]
HServo [P4\Pos1\Spd1]
nodata:
Toggle P44 'Status LED
Pause 100
I have been through the manuals old and new and I am over looking something simple maybe a push in the right direction would be helpful.
Thanks
John