Can anyone help me, please?

Reply

Join Date: Feb 2004
Posts: 4
Reputation: leongaj is an unknown quantity at this point 
Solved Threads: 0
leongaj leongaj is offline Offline
Newbie Poster

Can anyone help me, please?

 
0
  #1
Feb 11th, 2004
Can anyone help me to convert the following BASIC langauge into Visual Basic source code? Please help. I'm new in programming. Thanks alot.
-----------
NEW

10 REM Test Program Four - RG 9305.11
11 REM Walking Program for BORIS Connected to PC Parallel Port
12 REM Control from numeric keypad: UP arrow = Forward, etc.
13 REM
14 REM Send bits to the parallel port with LPRINT CHR$(Bits);
15 REM
16 REM Bits = 1*n + 2*n + 4*n + 8*n + 16*n + 32*n + 64*n + 128*n
17 REM
18 REM Bits equation sets bits ON if n = 1 or OFF if n = 0
19 REM First position (1*n) is bit 0
20 REM Last position (128*n) is bit 7
21 REM Calculate with each n to 1 or 0 for other output patterns
22 REM
23 REM Note: Ending semicolon ( on LPRINT command holds
24 REM bit pattern at parallel port until next LPRINT
25 REM

30 DELAY = 350: REM Increase for slower walk, decrease for faster

40 PRINT "Press keypad arrow keys for Fwd, Back, Left, Right"
50 PRINT "Press space bar for Stop"
60 PRINT "Press Q at any time to Quit"

100 REM Stop walking
110 LPRINT CHR$(0); : GOSUB 1000: REM Clear All Bits
120 GOTO 100

200 REM Walk Forward
210 LPRINT CHR$(65); : GOSUB 1000: REM Bit 6, 0 ON
220 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON
230 LPRINT CHR$(130); : GOSUB 1000: REM Bit 7, 1 ON
240 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON
250 GOTO 200 300 REM Walk Reverse
310 LPRINT CHR$(65); : GOSUB 1000: REM Bit 6, 0 ON
320 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON
330 LPRINT CHR$(130); : GOSUB 1000: REM Bit 7, 1 ON
340 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON
350 GOTO 300

400 REM Rotate Left 410 LPRINT CHR$(66); : GOSUB 1000: REM Bit 6, 1 ON
420 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON
430 LPRINT CHR$(129); : GOSUB 1000: REM Bit 7, 0 ON
440 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON
450 GOTO 400

500 REM Rotate Right
510 LPRINT CHR$(66); : GOSUB 1000: REM Bit 6, 1 ON
520 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON
530 LPRINT CHR$(129); : GOSUB 1000: REM Bit 7, 0 ON
540 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON
550 GOTO 500


1000 REM Check Key Press and Do Delay Loop
1010 A$ = INKEY$
1020 IF A$ = " " THEN PRINT "Stop": LPRINT CHR$(0); : GOTO 100
1030 IF A$ = CHR$(0) + "H" THEN PRINT "Forward": LPRINT CHR$(0); : GOTO 200
1050 IF A$ = CHR$(0) + "P" THEN PRINT "Reverse": LPRINT CHR$(0); : GOTO 300
1060 IF A$ = CHR$(0) + "K" THEN PRINT "Left" : LPRINT CHR$(0); : GOTO 400
1070 IF A$ = CHR$(0) + "M" THEN PRINT "Right" : LPRINT CHR$(0); : GOTO 500
1080 IF A$ = "Q" OR A$ = "q" THEN LPRINT CHR$(0); : END

1100 FOR I = 1 TO DELAY
1110 NEXT I
1120 RETURN
1900 END

RUN
----------
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 4
Reputation: leongaj is an unknown quantity at this point 
Solved Threads: 0
leongaj leongaj is offline Offline
Newbie Poster

Re: Can anyone help me, please?

 
0
  #2
Feb 11th, 2004
You may send the source code to my email. Please help. Thanks alot.
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 4
Reputation: leongaj is an unknown quantity at this point 
Solved Threads: 0
leongaj leongaj is offline Offline
Newbie Poster

Re: Can anyone help me, please?

 
0
  #3
Feb 11th, 2004
My email is leongaj@yahoo.com.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Can anyone help me, please?

 
0
  #4
Feb 12th, 2004
so you want someone to convert this for you? Interesting request. Let me ask you what version on visual basic do you have right now?

where did you get he source code in BASIC from? Do you have the source files for it? If so post them. Makes it easier to convert.
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 4
Reputation: leongaj is an unknown quantity at this point 
Solved Threads: 0
leongaj leongaj is offline Offline
Newbie Poster

Re: Can anyone help me, please?

 
0
  #5
Feb 17th, 2004
Actually, I'm 1st year student majoring in Robotic. This BASIC code is used as a program to control a six legged robot called BORIS using parallel port. The program is to send set of bits to parallel port. The original source code is here http://www.musclewires.com/mwpb.html . And I'm a beginner in Visual Basic. I'm using Visual Basic.net. Maybe you can just write an simple code like how to send bits to the parallel port using VB.net in windows XP to me. Highly appreciate your kindness. Thanks a lot.
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 1
Reputation: ScottMcg is an unknown quantity at this point 
Solved Threads: 0
ScottMcg ScottMcg is offline Offline
Newbie Poster

Re: Can anyone help me, please?

 
0
  #6
May 6th, 2004
Sorry, Leon. It's going to take a lot more than a code translation to make this thing work. Direct access to the lprint chr$(number) command was last available in QBasic. Microsoft has taken away the ability to control the parallel port in VB. I hear there's some loopholes in the windows API so it's not impossible, but I haven't been able to make my parallel port work yet.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 9
Reputation: johntech is an unknown quantity at this point 
Solved Threads: 0
johntech johntech is offline Offline
Newbie Poster

Re: Can anyone help me, please?

 
0
  #7
Jun 3rd, 2007
Search Amazon or the internet for a book called Parallel Port Complete by Jan Axelson. It has circuit diagrams and lots of vb code. It is about 330+ pages. If you are using the parallel port to controll things, you need this book!!!

John
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 15,976
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 506
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Can anyone help me, please?

 
0
  #8
Jun 3rd, 2007
use ' instead of REM
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC