Commit 4e843124 by kollo

added bluetooth and usb examples

parent 3efe11cc
' Test of the bluetooth functions of X11-Basic Version >= 1.25
'
'
' Scan for bluetooth devies around:
'
'
PRINT "Following devices could be found nearby:"
a$=FSFIRST$("","*","b")
while len(a$)
print a$
PRINT "Adress: ";WORD$(a$,1)
PRINT "Name: ";WORD$(a$,2)
adr$=word$(a$,1)
a$=FSNEXT$()
wend
PRINT "Now try to connect to ";adr$
OPEN "UL",#1,adr$,1
print #1,"Test"
CLOSE
quit
' Test of the USB functions of X11-Basic Version >= 1.25
'
'
' Scan for USB devies around:
'
'
PRINT "Following USB devices could be found nearby:"
a$=FSFIRST$("","*","u")
while len(a$)
print a$
@decode(a$)
a$=FSNEXT$()
wend
quit
procedure decode(a$)
print " USB bus/device: ";word$(a$,1)
print " USB vendor-ID/product-ID: ";word$(a$,2)
print " Manufacturer: ";word$(a$,3)
print " Product: ";word$(a$,4)
print " Serial-Nr: ";word$(a$,5)
print " Number of configurations: ";word$(a$,6)
return
......@@ -9,11 +9,32 @@
'
' (c) by Markus Hoffmann 2015
' X11-Basic Version >= 1.24
' improved for use with X11-Basic >=1.25 2016-10 MH
'
'
debug=0 ! set to 1 if you want verbose information
protocol=1 ! for VDL101T
' First check if the logger is connected
print "searching for VDL101T logger..."
found=FALSE
a$=FSFIRST$("","*","u")
WHILE LEN(a$)
IF UPPER$(WORD$(a$,2))="10C4/EA61"
found=TRUE
ENDIF
a$=FSNEXT$()
WEND
IF NOT found
PRINT "Sorry, the logger VDL101T could not be found."
PRINT "Is ist plugged in?"
QUIT
ENDIF
PRINT "logger found. Connecting..."
PRINT "NOTE: If this step causes problems, try to unload the (wrong) kernel driver"
PRINT "sudo rmmod cp210x"
PRINT "and try to run this program as root."
' Open the USB-Device by Product and Vendor Number
OPEN "UY",#1,"0x10c4:0xea61"
@print_device_info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment