GPIO on Raspberry Pi

Post your Gambas programming questions here.
ocoquet
Posts: 36
Joined: Friday 18th December 2020 7:56am

Re: GPIO on Raspberry Pi

Post by ocoquet » Wednesday 23rd December 2020 2:29pm

Sorry, don't understand what is this :?:

Regards
Olivier Coquet
Gambas Dev
Le Forum développeur Gambas

User avatar
Matthew-Collins
Posts: 11
Joined: Wednesday 21st September 2016 7:59pm
Location: Guernsey, Channel Islands

Re: GPIO on Raspberry Pi

Post by Matthew-Collins » Friday 25th December 2020 9:51am

Hi,

This is a Gambas class, so create a new class file in your project called "GPIO_Pin" and copy and paste the code into it...
https://raw.githubusercontent.com/Matth ... _Pin.class

Then in your code:
Dim Pin As New GPIO_Pin(16)
Pin.SetDirection(False)

For i as Integer = 0 to 1000
    Print str(i) & "-" & str(Pin.GetValue())
Next

Print "Done"

Let me know how you get on / if this is helpful ?

Happy Christmas
Cheers
Matt

ocoquet
Posts: 36
Joined: Friday 18th December 2020 7:56am

Re: GPIO on Raspberry Pi

Post by ocoquet » Friday 25th December 2020 3:24pm

Thank's but.....

Just, I've no question :P :lol:
I was just answering to the forum topic, personally i use wiringpi with a real success :D

Regards and Happy Christmas
Olivier
Olivier Coquet
Gambas Dev
Le Forum développeur Gambas

User avatar
Matthew-Collins
Posts: 11
Joined: Wednesday 21st September 2016 7:59pm
Location: Guernsey, Channel Islands

Re: GPIO on Raspberry Pi

Post by Matthew-Collins » Saturday 26th December 2020 7:35am

Hi, can you post a WiringPi example/demo project ?
Cheers
Matt

User avatar
stevedee
Posts: 446
Joined: Monday 20th March 2017 6:06pm

Re: GPIO on Raspberry Pi

Post by stevedee » Saturday 26th December 2020 7:54am

Matthew-Collins wrote:
Saturday 26th December 2020 7:35am
...can you post a WiringPi example...
https://elinux.org/RPi_GPIO_Code_Samples#Gambas

Note: 1) I don't think you need root for latest wiringPi,
2) Gordon got the 'ump with abuse, so stopped updating wiringPi some time ago: https://captainbodgit.blogspot.com/2019 ... mouth.html

Post Reply