Need help on simple prog

Hello, i’m trying to make a program for my Bot Board to SSC 32. I’ve tried the sample program but its not working. It says Error: FILE C:\USERS\JARETH FRANK\DESKTOP\ABB PROTOTYPE\PROGRAMMING\LASER CELL TEST PROG.BAS(LINE 57) : [TOKEN "#"] : Unexpected token type

[code]SERVO0PW VAR WORD
MOVETIME VAR WORD

SERVO0PW = 650
MOVETIME = 2500

START:
SERVO0PW = 650
SEROUT P15,I38400, “#OP”,DEC SERVO0PW, “T”, DEC MOVETIME,13]
PAUSE 2500
SERVO0PW = 2000
SEROUT P15,I38400, “#OP”,DEC SERVO0PW, “T”, DEC MOVETIME,13]
PAUSE 2500
GOTO START

AA VAR BYTE
S0 VAR WORD
S1 VAR WORD
S2 VAR WORD
S3 VAR WORD
S4 VAR WORD
S5 VAR WORD
S6 VAR WORD
S7 VAR WORD
TTM VAR WORD

FOR AA=0 TO 9
SEROUT P15,I38400,"#",DEC2 AA\1, “P”, DEC 1500,13]
NEXT

S0=750: S1=650: S2=1440: S3=2240:
S4=2250: S5=1430: S6=1540: S7=1492:
TTM=800
GOSUB SEND_DATA
PAUSE TTM

S0=800: S1=800: S2=2000: S3=1800
S4=1500: S5=800: S6=1540: S7=1492
TTM=800
GOSUB SEND_DATA
PAUSE TTM

S0=750: S1=650: S2=1440: S3=2240
S4=2250: S5=1430: S6=1540: S7=1492
TTM=800
GOSUB SEND_DATA
PAUSE TTM

goto START

SEND_DATA:

SEROUT P15,I38400, “#0P”,DEC S0, “#1P”,DEC S1, “#2P”,DEC S2, “#3P”,DEC S3,
#4P”,DEC S4, “#5P”,DEC S5, “#6P”,DEC S6, “#7P”,DEC S7, “T”,DEC TTM,13]
RETURN
[/code]

bane

Looks like the last line may have a CR, making it essentially two lines of code. It needs to be one long line. Remove the carriage return in the middle of the command.

like,

SEROUT P15,I38400, "#0P",DEC S0, "#1P",DEC S1, "#2P",DEC S2, "#3P",DEC S3, "#4P",DEC S4, "#5P",DEC S5, "#6P",DEC S6, "#7P",DEC S7, "T",DEC TTM,13]
is this what your talking about?
what is the carriage?

or

part?

Go to the end of this line.

SEROUT P15,I38400, “#0P”,DEC S0, “#1P”,DEC S1, “#2P”,DEC S2, “#3P”,DEC S3,

  • and hit backspace once. Then the below should wrap to make one long line.

#4P”,DEC S4, “#5P”,DEC S5, “#6P”,DEC S6, “#7P”,DEC S7, “T”,DEC TTM,13]

Ok it complied fine but now my ssc-32 just flashes and no motion.
I’m supposed to have RX to pin 15 right?

If the LED is flashing then it is receiving data. Do you have the baud rate jumpers on the SSC-32 set for 38.4k?

To answer your previous question the for next loop will happen 10 times. Setting servos 0 through 9 to position 1500. I was eating lunch so I couldn’t answer everything. Mmmm pizza! lol

yes i have it set on 38.4k
what pin do have to have the Rx on?

The Atom is sending data (TX) on pin 15…

SEROUT P15

There is no need for RX because your program isn’t reading data from the SSC-32.

Do you have power for the servos on VS1 or VS2?

yes

oh, i’m using the jumper wire that the servo controller came with and its connected to ground and RX

Do i have to modify the cable to connect it to TX?

No need to modify the cable. The Atom is connected to the (RX) on the SSC-32. Like I said before because the LED is blinking the SSC-32 IS receiving data. You still have no motion? Do the servos hold position?

no its like the servo don’t exist. Can you look a my program again?
im pretty sure that i have all the hardware set up right because i can control the ssc-32 with Lynxterm and it works fine.

[code]SERVO0PW VAR WORD
MOVETIME VAR WORD

SERVO0PW = 800
MOVETIME = 2000

START:
SERVO0PW = 650
SEROUT P15,I38400, “#OP”,DEC SERVO0PW, “T”, DEC MOVETIME,13]
PAUSE 2500
SERVO0PW = 2000
SEROUT P15,I38400, “#OP”,DEC SERVO0PW, “T”, DEC MOVETIME,13]
PAUSE 2500
GOTO START

AA VAR BYTE
S0 VAR WORD
S1 VAR WORD
S2 VAR WORD
S3 VAR WORD
S4 VAR WORD
S5 VAR WORD
S6 VAR WORD
S7 VAR WORD
TTM VAR WORD

FOR AA=0 TO 9
SEROUT P15,I38400,"#",DEC2 AA\1, “P”, DEC 1500,13]
NEXT

S0=750: S1=650: S2=1440: S3=2240:
S4=2250: S5=1430: S6=1540: S7=1492:
TTM=800
GOSUB SEND_DATA
PAUSE TTM

S0=800: S1=800: S2=2000: S3=1800
S4=1500: S5=800: S6=1540: S7=1492
TTM=800
GOSUB SEND_DATA
PAUSE TTM

S0=750: S1=650: S2=1440: S3=2240
S4=2250: S5=1430: S6=1540: S7=1492
TTM=800
GOSUB SEND_DATA
PAUSE TTM

goto START

SEND_DATA:
SEROUT P15,I38400, “#0P”,DEC S0, “#1P”,DEC S1, “#2P”,DEC S2, “#3P”,DEC S3, “#4P”,DEC S4, “#5P”,DEC S5, “#6P”,DEC S6, “#7P”,DEC S7, “T”,DEC TTM,13]
RETURN
[/code]

Is there anywere else to let the program know that i’m using pin 15?

I’m going to let you find your problem. hint a it’s really simple blatantly obvious error that I didn’t even see right away. When you find it you will want to kick yourself. lol

Pin 15 is used in the serouts and it’s fine.

Ok, capital letter O looks a lot like a zero. That’s all I’m saying…

SEROUT P15,I38400, "#OP",DEC SERVO0PW, "T", DEC MOVETIME,13] PAUSE 2500 SERVO0PW = 2000 SEROUT P15,I38400, "#OP",DEC SERVO0PW, "T", DEC MOVETIME,13]
nice lol. i just programmed it and p0 is working. do i have to repeat the code above for all my 8 servos?

The code below your…
start:
test code
goto start

worked for me, so I assumed you had forgotten to remove test code. But after I uncommented it out I realized that was where the problem you were having was. It took me a while to see the O where the 0 was supposed to be. :smiling_imp:

So you made me type through pizza, and stay an hour late. :smiling_imp:

It’s ok, I really wanted to figure it out for you. Remember computers do exactly what you tell them to do and care very little about what you want them to do. :wink: And talk about literal… Good luck I’m going home…

man i don’t care what they say about you, your all right :smiley: .
I just commented the things and its fine. if i messed around some more i’d probably figure out why the servos are moving so slowly

DEC MOVETIME,13]

im guessing if i play around with the number i can change the speed

Thanks!