Shop OBEX P1 Docs P2 Docs Learn Events
Simple toy RF — Parallax Forums

Simple toy RF

Tricky NekroTricky Nekro Posts: 218
edited 2006-01-30 18:57 in Robotics
Greating to everyone...

This is a project done in order to control the Boe-Bot with a simple RF toy transmiter...
The reciver is mounted on the breadboard through a mini resistor board...
The max range of the module is about 100 - 200 meters... quit well for such an old module

The exable code:

' {$STAMP BS2}
' {$PBASIC 2.5}
' Code writen by Provas For
' Greekbotics.tk...
' Provas - The DeadGuy
' Copyrights 2004 - 2006


AP1 VAR Bit
AP2 VAR Bit
AP3 VAR Bit
AP4 VAR Bit

DO
DEBUG
CLS
AP2 = IN3
AP1 = IN5
AP3 = IN7
AP4 = IN8
DEBUG BIN AP1, CR
DEBUG BIN AP2, CR, CR
DEBUG BIN AP3, CR
DEBUG BIN AP4
PAUSE 100
LOOP

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

' Code writen by Provas For
' Greekbotics.tk...
' Provas - The DeadGuy
' Copyrights 2004 - 2006

AP1 VAR Bit
AP2 VAR Bit
AP3 VAR Bit
AP4 VAR Bit

AP1 = 0
AP2 = 0
AP3 = 0
AP4 = 0

DO

AP1 = IN5
AP2 = IN3
AP3 = IN7
AP4 = IN8

IF (AP1 = 1) AND (AP2 = 0) AND (AP3 = 0) AND (AP4 = 0) THEN
GOSUB Forward
ELSEIF (AP1 = 0) AND (AP2 = 1) AND (AP3 = 0) AND (AP4 = 0) THEN
GOSUB Backward
ELSEIF (AP1 = 1) AND (AP2 = 1) AND (AP3 = 1) AND (AP4 = 1) THEN
GOSUB Center
ELSEIF (AP1 = 0) AND (AP2 = 0) AND (AP3 = 0) AND (AP4 = 0) THEN
GOSUB Center
ELSEIF (AP1 = 1) AND (AP2 = 0) AND (AP3 = 1) AND (AP4 = 0) THEN
GOSUB Turn_Left
ELSEIF (AP1 = 1) AND (AP2 = 0) AND (AP3 = 0) AND (AP4 = 1) THEN
GOSUB Turn_Right
ELSEIF (AP1 = 0) AND (AP2 = 1) AND (AP3 = 1) AND (AP4 = 0) THEN
GOSUB Center
ELSEIF (AP1 = 0) AND (AP2 = 1) AND (AP3 = 0) AND (AP4 = 1) THEN
GOSUB Center
ENDIF
LOOP

Forward:
PULSOUT 12, 650
PULSOUT 13, 850
PAUSE 10
RETURN

Backward:
PULSOUT 12, 850
PULSOUT 13, 650
PAUSE 10
RETURN

Turn_Left:
PULSOUT 12, 850
PULSOUT 13, 850
PAUSE 10
RETURN

Turn_Right:
PULSOUT 12, 650
PULSOUT 13, 650
PAUSE 10
RETURN

Center:
PULSOUT 12, 750
PULSOUT 13, 750
PAUSE 10
RETURN

By Tomorrow I'll have it mounted on a test mini bot and will upload a video with it's manuvers!!!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--


provassiggy5yt.jpg

Comments

  • Steve JoblinSteve Joblin Posts: 784
    edited 2006-01-29 23:53
    What is the third picture (the long rectangle board with a right angle header on one end)?
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-30 16:28
    It's series of resistors in order to interface the outputs of the RF with the stamp...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-30 17:56
    Provas,

    · I think that I have saved you some·EEPROM space by modifying your program (adding some variables, re-rendering your IF...THENs)· Have I succeeded?
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-30 18:57
    Yes and thanks for the try but...

    This is only the test code and not the main time run code...

    You have tried to save EEPROM and entered new variables...



    I'm working on a multibot so I need bot RAM and EEPROM map flexibility...



    Thank you very very much about your intrest...

    I'll need it as I procceed my project...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
Sign In or Register to comment.