Hello VEL255 !
I like to thank you very much for the given support.
The first given example was operating immediately. From now on a new world has been opened for me.
With regards,
Ton, I/O hobbyïst.
Hello VEL255 !
I like to thank you very much for the given support.
The first given example was operating immediately. From now on a new world has been opened for me.
With regards,
Ton, I/O hobbyïst.
No problem. Glad to be of assistance
Hi !
Somewhere in last octobre I got a nice message from you about the use of the VM110 I/O-unit in combination with LibertyBasic.
In the meantime I did a lot of experiments with both the hardware and the software. So of one of them I like to tell you something.
Some time ago I made a hardware citcuitry that I controlled at that moment with the Raspberry Pi. I made a circle of 24 leds : three groups of 8 leds each. The intention was to make a running light over all these leds.
So recently I asked myself how to control this hardware with the only 8 outbits of the VM110. The main problem was how to control the separate groups of leds, because there are no sufficient extra outbits. I used a small trick and used the DAC-outs as “dummy-outs”. With these “trick” I could manage two run-speeds and two running-directions.
Like to see the result ? You can have a look at :
Vimeo demo leds-carroussel youtu.be/-rMLkjk570I .
To make the story complete I try to put the LibertyBasic listing IN this mail ( I don’t know how to connect an attachment with the name.bas )
( the comments in a lot of lines I did in Dutch . . . . . . )
Thank You for the attention !
Regards, Ton Scheepens.
'Programma voor de ledjes-carroussel (nov 2014 )
MaxLoops = 5 'om het aantal loops vast te stellen voor de eerste run
[BEGIN]
open “K8055D.dll” for dll as #user
calldll #user,“OpenDevice”, 0 as long, h as long
calldll #user,“ClearAllAnalog”, h as long
calldll #user,“ClearAllDigital”, h as long
AantalLoops = 0 'initialisatie ; teller voor het aantal loops
snel = 30000 : traag = 10000 'beide bepalen de loopsnelheid
[OpnieuwLinksom]
calldll #user,“ReadDigitalChannel”, 1 as long, h as long, result as long 'keuzeschakelaar voor de looprichting
if result = 1 then goto [OpnieuwRechtsom]
if AantalLoops = MaxLoops then goto [STOP]
AantalLoops = AantalLoops + 1
calldll #user,"ReadDigitalChannel", 2 as long, h as long, result as long 'keuzeschakelaar voor de loopsnelheid
if result = 1 then delay = traag else delay = snel
calldll #user,"ClearAllAnalog", h as long 'met beide analoge outputs wordt de groep bepaald
'er zijn drie groepen van 8 leds elk. met de beide analoge outputs worden twee keuzebits gesimuleerd : 0Volt of 5 Volt.
groep = 0
[LINKSOM]
calldll #user,“ClearAllDigital”, h as long
for z = 1 to 8 'alle bits van de aangewezen groep één voor één schuiven
calldll #user,“SetDigitalChannel”, z as long, h as long
for i = 1 to delay 'de loopsnelheid bepalen
next i
calldll #user,“ClearDigitalChannel”, z as long, h as long
next z 'volgende ledje
groep = groep + 1
calldll #user,“ClearAllAnalog”, h as long
calldll #user,“OutputAnalogChannel”,groep as long, 250 as long, h as long
'250 komt overeen met ~5 Volt : wordt geïnterpreteerd als 'n logische 1
if groep >2 then goto [OpnieuwLinksom] else goto [LINKSOM]
[OpnieuwRechtsom]
calldll #user,“ReadDigitalChannel”, 1 as long, h as long, result as long
if result = 0 then goto [OpnieuwLinksom]
if AantalLoops = MaxLoops then goto [STOP]
AantalLoops = AantalLoops + 1
calldll #user,"ReadDigitalChannel", 2 as long, h as long, result as long
if result = 1 then delay = traag else delay = snel
groep = 2
[RECHTSOM]
calldll #user,“OutputAnalogChannel”,groep as long, 250 as long, h as long
if groep = 0 then calldll #user,“ClearAllAnalog”, h as long
for z = 8 to 1 step -1 'alle bits van de aangewezen groep één voor één andersom schuiven
calldll #user,“SetDigitalChannel”, z as long, h as long
for i = 1 to delay 'de loopsnelheid bepalen
next i
calldll #user,“ClearDigitalChannel”, z as long, h as long
next z 'volgende ledje
groep = groep - 1
calldll #user,“ClearAllAnalog”, h as long
calldll #user,“ClearAllDigital”, h as long
if groep <0 then goto [OpnieuwRechtsom] else goto [RECHTSOM]
[STOP]
calldll #user,“ClearAllDigital”, h as long
calldll #user,“ClearAllAnalog”, h as long
calldll #user,“CloseDevice”, h as long : close #user
mainwin 40 10
input "hoeveel nieuwe loops " ; MaxLoops 'variabele voor het ingevoerde aantal
goto [BEGIN]
Looks nice, well done!
Indeed, good to see that it is possible to control individually 24 LEDs with the 8 digital and 2 analog outputs of the VM110 !