Sticky
12-09-2009, 10:33 AM
I'm just starting with the propeller chip and I wonder if I can get some help. I'm trying to use the older model of the servo controller and I can't get it to work. I've included a picture of the breadboard setup and servo controller and servo. The controller and servo work with a BOE so I know they are good. I'm using the servo controller object and the basic stamp object. I'm sure it's a simple thing that I've missed. Thanks for the help.
Code, (I couldn't upload it.)
var
byte j,k
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
led = 0
photo_cell = 15
tx_pin = 30
rx_pin = 31
COMPIN = 15 'Pin used for communication with the PSC
PSC_BAUD = 0 'Baud rate (0 - 2400, 1 - 38400)
obj
bs2 : "bs2_functions_1_3_5.spin"
PSC : "ServoControllerSerial"
pub main
'it's not working??? wth
bs2.start (rx_pin,tx_pin)
PSC.START(COMPIN, PSC_BAUD)
bs2.pause (1000)
J := 4
REPEAT UNTIL J == 0
ledon
PSC.SETPOS (1,9,500)
bs2.pause (1000)
PSC.SETPOS (1,9,1000)
bs2.pause (1000)
PSC.SETPOS (1,9,750)
ledoff
BS2.PAUSE(2000)
J --
J := 5
REPEAT UNTIL J == 0
ledon
BS2.PAUSE (250)
ledoff
BS2.PAUSE (250)
J --
PUB LedOn
dira[led] := 1
outa[led] := 1
PUB LedOff
dira[led] := 1
outa[led] := 0
Code, (I couldn't upload it.)
var
byte j,k
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
led = 0
photo_cell = 15
tx_pin = 30
rx_pin = 31
COMPIN = 15 'Pin used for communication with the PSC
PSC_BAUD = 0 'Baud rate (0 - 2400, 1 - 38400)
obj
bs2 : "bs2_functions_1_3_5.spin"
PSC : "ServoControllerSerial"
pub main
'it's not working??? wth
bs2.start (rx_pin,tx_pin)
PSC.START(COMPIN, PSC_BAUD)
bs2.pause (1000)
J := 4
REPEAT UNTIL J == 0
ledon
PSC.SETPOS (1,9,500)
bs2.pause (1000)
PSC.SETPOS (1,9,1000)
bs2.pause (1000)
PSC.SETPOS (1,9,750)
ledoff
BS2.PAUSE(2000)
J --
J := 5
REPEAT UNTIL J == 0
ledon
BS2.PAUSE (250)
ledoff
BS2.PAUSE (250)
J --
PUB LedOn
dira[led] := 1
outa[led] := 1
PUB LedOff
dira[led] := 1
outa[led] := 0