REMOTE TEST WITH RUN BASIC


The page may need refreshed from time to time if the video stops.

Please turn the light off when you leave.

MACKRACKIT main RB page.


Simple demo to show the versatility of Run Basic.  When "LED ON" or "LED OFF" is clicked, Run Basic writes to a file.
Then a program written with Liberty Basic program reads the file and sends a command via serial port to a PIC chip.


The Run Basic code:
[display]
cls
link #write, "LED ON", [ON]
print" "
link #write, "LED OFF", [OFF]
wait

[ON]
open "C:\RB\port\port.txt" for output as #f
print #f, 91
close #f
goto [display]

[OFF]
open "C:\RB\port\port.txt" for output as #f
print #f, 93
close #f
goto [display]

The Liberty Basic code:
[setup.main.Window]

'-----Begin code for #main

nomainwin
WindowWidth = 300
WindowHeight = 150
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)

'-----Begin GUI objects code

textbox #main.comsel, 25, 32, 180, 25
textbox #main.textbox1, 25, 62, 50, 25

'-----End GUI objects code

open "untitled" for window as #main
print #main, "font ms_sans_serif 10"
print #main, "trapclose [quit.main]"

[main.inputLoop]
open "savecom.txt" for input as #SC
CN$ = input$(#SC, lof(#SC))
print #main.comsel, CN$
close #SC
COMM$ = CN$
oncomerror [handleIt]
open COMM$ for random as #com

[RUN]
open "port.txt" for input as #f
LINE INPUT #f, txt$
print #main.textbox1,txt$
print #com,txt$
close #f
calldll #kernel32,"Sleep",500 as ulong,r as void
scan
goto [RUN]
wait

[quit.main] 'End the program
close #main
close #com
end

[handleIt]
oncomerror
notice "Error: Com Port. "; ComError$
notice "Com Port number: "; ComPortNumber
notice "Please select another Com Port in the savecom.txt file"
close #main

savecom.txt:
COM1:9600,n,8,1,ds0,cs0,rs



Created with