[Gambas-user] Write a new component: Firmata (Second attempt)

Benoît Minisini g4mba5 at gmail.com
Tue Mar 27 18:16:16 CEST 2018


Le 27/03/2018 à 17:43, Matias De lellis a écrit :
> 
> 
> 2018-03-27 12:19 GMT-03:00 Benoît Minisini <g4mba5 at gmail.com 
> <mailto:g4mba5 at gmail.com>>:
> 
> 
>     Anyway, I looked at your code, but didn't understand the goal of all
>     these controls.
> 
>     If you can explain. :-)
> 
> 
> The idea is to take advantage of the Firmata protocol, to make an HID 
> interface that interacts with the hardware without programming the 
> arduino board.. For example you can see the status any sensors, and ie 
> see the level of water in a tank, and add a routine in prawns, that when 
> empty, turn on the water pump. or control a weather station, and save 
> the data in the database ..
> 
> Now I'm only doing the minimum controls to control analog and digital 
> inputs and outputs.
> 
> 
> 
>     -- 
>     Benoît Minisini
> 

If you mix GUI and specific serial port processing in your controls, 
it's logical to make a specific component, or a library.

But if you want to have a LED-like control, you should not make it 
depend on anything, so that it can be put in gb.form.

And then, if you need a LED control with serial port processing, then 
make another control.

It's how gb.db.form was made: if I want a ComboBox control linked to a 
database field, I name it "DataComboBox".

Maybe you should do the same: find a prefix, for example "Firmata", so 
that you have "FirmataSwitchButton", "FirmataLed", and so on.

Regards,

-- 
Benoît Minisini


More information about the User mailing list