Featured Worklog

Price Search



PC Apex Sponsor


PC Apex Sponsors



PC Apex RSS Feeds

RSS Feed for PC Apex Reviews & ArticlesRSS Feed for PC Apex PC Modding WorklogsRSS Feed for the PC Apex Daily DisturbanceRSS Feed for the latest PC Apex Site NewsRSS Feed for PC Apex Affiliate and Web NewsRSS Feed for PC Apex Deals and Steals

Go Back   Apex Community Forums // Other Forums // Designers Corner // Coding / Scripting / Programming

Coding / Scripting / Programming Discussions on all manner of coding and scripting.

Reply
 
LinkBack Thread Tools Display Modes
Old 26-April-07, 09:41 AM   #1 (permalink)
Apex Master Tech Apprentice
icdpride's Avatar
Default Cubloc to BS2

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 50
x=x+1
Locate 16,3
Print Dec x

Loop
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
Out 44,0
Out 47,0
Out 45,1
Out 46,1

Endif
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
icdpride is offline     Reply With Quote
Old 07-May-07, 06:53 PM   #2 (permalink)
Master VB Pr'hoe'grammer
Monsignor Funkibut's Avatar
Default Re: Cubloc to BS2

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
Monsignor Funkibut is offline     Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright PCApex.com, GameApex.com, ForumApex.com 2001 - 2008
Advertisements

Page generated in 0.13940 seconds with 8 queries