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 »

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

Regards
Olivier Coquet
Gambas Dev
Le Forum développeur Gambas
User avatar
Matthew-Collins
Posts: 12
Joined: Wednesday 21st September 2016 7:59pm
Location: Guernsey, Channel Islands

Re: GPIO on Raspberry Pi

Post by Matthew-Collins »

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 »

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: 12
Joined: Wednesday 21st September 2016 7:59pm
Location: Guernsey, Channel Islands

Re: GPIO on Raspberry Pi

Post by Matthew-Collins »

Hi, can you post a WiringPi example/demo project ?
Cheers
Matt
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: GPIO on Raspberry Pi

Post by stevedee »

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
BabbRust
Posts: 1
Joined: Thursday 24th June 2021 6:14am

Re: GPIO on Raspberry Pi

Post by BabbRust »

Hi...the RPI4 has precisely the same GPIO pinout as the RPI3.
However, on the off chance that you need them, there are various new equipment fringe drivers that can be alloted to GPIO's, relatively few individuals use them yet, so there isn't a lot of information about them, however
Notwithstanding the heritage peripherals we have:

4 new PL011 UARTs with fair measured FIFOs

4 new I2C regulators with fixed (or diversely broken) clock extending

4 duplicates of the old SPI regulator

https://www.7pcb.com/
Post Reply