• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows extension for a USB RGB LED

Y

yoyowan

Guest
hello, I am fighting in order to make communicate this device with GMS :
https://blink1.thingm.com/


the device has an open source microcontroller integrated and features 2 RGB leds. It is made for making notifications.
There are several ways to drive it, and I have only managed to make it react in GMS through an external Cross-platform command-line tool for controlling blink(1) :
blink1-tool

It is the bad way because I want to make smooth color changing effects and I need to send lot of lines to the program like this (every frame) :

execute_application("C:\blink1-tool --id all -l1 --red");
execute_application("C:\blink1-tool --id all -l2 --blue");
execute_application("C:\blink1-tool --id all -l3 --red");
execute_application("C:\blink1-tool --id all -l4 --blue");
execute_application("C:\blink1-tool --id all -l5 --red");
...

However it is an open source project, there is a github with APIs for :
  • C / C++ / Objective-C / Qt
  • Java
  • Processing
  • Python
  • Node.js
  • .NET
  • Ruby
  • Go
  • Linux kernel
https://github.com/todbot/blink1
https://github.com/todbot/blink1
Is anyone could please drive me on the good road (I am lost with directories on github)... I am not a developer but I will dig, I just want to make this device react smoothly in GMS with an extension (and no more external calls). Thanks for reading and for future feedbacks.
 

Mike

nobody important
GMC Elder
Easiest thing would be to make a DLL that talks to it - or executes the command line, and you can then bind that into GameMaker as GML commands. But you will have to make a DLL yourself....
 
Y

yoyowan

Guest
Thank you Mike
Do you have any good links to forward on creating a dll ?
As previously said I will try to do my best to make it run. First DLL for me... But I will report my progress here
 

Yal

šŸ§ *penguin noises*
GMC Elder
I've never written a DLL myself (not one that interfaces with GM, at least) but from what I've gathered, you basically do the following:
  1. Create C functions that does what you want to do (in this case, interface with the LED).
  2. Compile as a DLL (I think the flag is -h for Windows' built-in compiler, but I'm not sure... check the documentation for whatever program you use to make the DLLs) and import as an included file in GM. If you interface to another DLL that is part of the LED system, make sure that's included as well.
  3. Use external_define() to link DLL functions, and then you call them with external_call().
 
Top