Shop OBEX P1 Docs P2 Docs Learn Events
Wireless controlled propeller — Parallax Forums

Wireless controlled propeller

samsn4samsn4 Posts: 49
edited 2006-11-19 21:43 in Propeller 1
I know this should go in the completed projects, but i have posted on the Playstation thread before and did noit get an any replies, so . . . Here's the code i'm using, only this code, do i need a TV drive code or what? because when i try to compile it it gives me an error (see attached)


' {$STAMP BS2}
' {$PBASIC 2.5}

VAR
buff VAR Byte(6)
idx VAR Nib
idy VAR Nib
tmpout VAR Byte

PsxAtt PIN 9
PsxClk PIN 8
PsxCmd PIN 10
PsxDat PIN 11
Servo PIN 12 'assuming it is on pin 12
ServoPos VAR WORD

MAIN:
DO
GOSUB Get_PSX_Buttons
ServoPos =buff(4) * 2 + 500
ServoPos =ServoPos MIN 500
ServoPos =ServoPos MAX 1000
PULSOUT Servo, ServoPos
PAUSE 10 ' reduce or remove this pause if servo acts erratic

LOOP
'
[noparse][[/noparse] Subroutines ]

Get_PSX_Buttons:
DIR10=1
DIR11=0
High PsxClk ' Change this to low if you use the transistor
LOW PsxAtt
FOR idy = 0 TO 2
LOOKUP idy,[noparse][[/noparse]$01,$42,$00],tmpout
FOR idx=0 TO 7
PsxCmd=tmpout.LOWBIT(idx)
PULSOUT PsxClk,2
NEXT
NEXT
FOR idy = 0 TO 5
FOR idx=0 TO 7
tmpout.LOWBIT(idx)=PsxDat
PULSOUT PsxClk,2
NEXT
Buff(idy)=tmpout
NEXT
HIGH PsxAtt
RETURN
END

- - - - - - -EDIT - - - - - - - - -

Ok so just figured out it's Basic code so is any spin code for controlling with a Pelican wireless controller?

Post Edited (samsn4) : 11/15/2006 6:58:02 PM GMT

Comments

  • BTXBTX Posts: 674
    edited 2006-11-16 00:26
    Sorry samsn4.
    Am I seeing right ?, or you're trying to program the propeller with BS2 code ?
    What's that ?

    Alberto.
  • samsn4samsn4 Posts: 49
    edited 2006-11-17 18:05
    yeah i noticed that, so is there are way to convert the code to spin or is there SPIN code for the pelican wireless, cause all i see is basic code.

    posted is the code from above, but in process of trying to be converted to spin.

    Thanks

    Post Edited (samsn4) : 11/17/2006 6:10:25 PM GMT
  • MacGeek117MacGeek117 Posts: 747
    edited 2006-11-19 21:43
    I would suggest reading through the Propeller Manual, especially chapter 3. It will give you lots of help.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
Sign In or Register to comment.