| |||||||
| Coding / Scripting / Programming Discussions on all manner of coding and scripting. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) | |
| hi i have writen this program in cubloc for the cubloc micro controller which is now dead and i have switched it out for a parallax basic stamp is there anybody who can hel convert this code or help me write new code? this is the code i have Const Device=cb280 Set Ladder Off Set Display 2,0,0,128 '************************************************* ********************** Dim x As Integer Dim a As String * 10 Dim TurnTime As Integer Dim DirTime As Integer Dim Dir As String Dim Turn As String Dim DirTimeStr As String * 1 Dim TurnTimeStr As String * 1 Opencom 1,115200,3,200,200 'Open Channel Set Until 1,4 On Recv1 Gosub DATARECV ' JUMP to DATARECV_RTN when data is received ' Clear send/receive buffers Bclr 0,2 '************************************************* ********************** a = "OhMy" TurnTime = 500 ' Turning Time DirTime=1000 'Time forward or backwards 'Erase screen x=0 Cls Delay 100 Csroff Locate 2,0 Print "Internet Kow" Locate 3,1 Print "By Shelato" Locate 2,2 Print "January 2007" Locate 0,3 Print "Wait" Do Delay 50Loop DATARECV: '************************************************* ********************** If Blen(1,0) > 0 Then ' if there is at least 1 byte in the buffer a=Getstr(1,4) ' Get 1 byte 'Debug a Dir=Left(a,1) DirTimeStr=Mid(a,2,1) DirTime=Val(DirTimeStr)*500 Turn=Mid(a,3,1) TurnTimeStr=Right(a,1) TurnTime=Val(TurnTimeStr)*400 x=1 'Cls Delay 50 Locate 0,3 Bclr 1,0 If Turn = "L" Then 'Activate relays for Left Turn ' Make sure the relays are all off before switching poles Out 41,0 Out 42,0 Out 40,1 Out 43,1 Elseif Turn = "R" Then 'Activate relays for Right turn Out 40,0 Out 43,0 Out 41,1 Out 42,1 Endif If Dir = "F" Then 'Activate relays to move forward ' Make sure the relays are all off before switching poles Out 45,0 Out 46,0 Out 44,1 Out 47,1 Elseif Dir = "R" Then 'Activate relays for reverse move EndifOut 44,0 Delay TurnTime ' Make sure the relays are all off before switching poles Out 40,0 Out 43,0 Out 41,0 Out 42,0 Delay DirTime-TurnTime ' Make sure the relays are all off before switching poles Out 44,0 Out 47,0 Out 45,0 Out 46,0 Endif What i need it to do is use an ethernet conection to conect and send data to the basic stamp that then send comands to the polulo micro serial servo controller which then turns a servo Basicly this is what i need to do Tech Art Blog: Touch w. CUBLOC and Xport if there is anyone that could help that would be great thanks | ||
| | | |
| Sponsored Links |
| | #2 (permalink) | |
| I looked on Google but didn't see anything that would directly convert from one set of code to the other. All those out commands appear to be sending a single bit to either a memory address or an address line. There's no telling [w/o alot of reading and specialized knowledge] what the matching addresses to perform the same functions are on the Parallax. That Polulo controller is a robotics piece right? Maybe you can find someone who has interfaced it with a Parallax. Sorry I can't be more help. -MF | ||
| | | |
![]() |
| Thread Tools | |
| Display Modes | |
| |