[Gambas-user] Question about gambas and raspberry
Pierre Deswysen
pierre.deswysen at gmail.com
Mon Apr 6 17:17:11 CEST 2020
Thank you very much for your help, with the timer it's solved.
Thanks to Roberto
I don't need to send you an example.
Thanks to T Lee Davidson
Glad that list is still alive and well.
The forum in french not active 😫
Le lun. 6 avr. 2020 à 15:49, T Lee Davidson <t.lee.davidson at gmail.com> a
écrit :
> On 4/6/20 7:51 AM, Pierre Deswysen wrote:
> > Hello,
> >
> > I discover Gambas, which I haven't used for a few years.
> >
> > I use the pigpio library.
> > Installation and use ok following example here :
> > https://elinux.org/RPi_GPIO_Code_Samples#Gambas_with_pigpio
> >
> > I have a problem because I don't know how to read a GPIO entry without
> using a button.
> >
> >
> > I have this function
> >
> > /Public Sub Counter1()
> > //Print "counter"
> > //gpioSetMode(PinButton1, InputPin)/
> > /Do
> > //
> > // If gpioRead(PinButton1) = 0 Then
> > // Button1CounterValue = Button1CounterValue + 1
> > // Print CounterValueButton1
> > // ValueBox1.Value = ValueCounterButton1
> > // Wait 1
> > // Endif
> > //
> > //Loop
> > /
> > /End/
> >
> >
> > I'm running this function in :
> >
> > /Public Sub Form_Open()//
> > //End/
> >
> >
> > But gambas don't...
> > I'm thinking of an endless loop problem
> >
> > Thank you in advance for your advice
> >
> > Pierre
>
> It is difficult to determine what may be happening especially since you
> use *three different* variables in the Do loop:
> Button1CounterValue = Button1CounterValue + 1
> Print CounterValueButton1
> ValueBox1.Value = ValueCounterButton1
>
> First, you increment Button1CounterValue.
> Then, you print CounterValueButton1; a different variable.
> Finally, you assign the value of ValueCounterButton1; yet another
> different variable.
>
> And, the example you linked to does not have any of that. Could you
> perhaps send a complete example project so we can better see
> what the overall environment is?
>
>
> --
> Lee
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200406/0448ef3b/attachment.html>
More information about the User
mailing list