Simple Python wrapper and demo
-
Thanks for the clear example.
Is there a reason I can't access pins 15-17 (extension board RGB led)?
I can update the values using (b)ash fast-gpio commandsroot@Omega1:~# ls /sys/class/gpio/
export gpio1 gpio13 gpio18 gpio23 gpio6 gpio8 unexport gpio0 gpio12 gpio14 gpio19 gpio26 gpio7 gpiochip0
-
@Dan-L. Thank you for sharing that implementation.
I used your implementation, then added support for pin 8 ( via fast-gpio ). I also set it up so it could run on my mac in a simulated way.
Here is a link to a video showing it all work.
https://www.youtube.com/watch?v=jDDq9D50wGo
Thanks gain
-
@Romans-Bermans So for the pushbutton, how is that wired? It's hard to tell from the photo. It looks like the green leg is connected to 2V and the black leg is connected to RST? Please confirm. Thanks!
-
@Steve-Fister Probably not. Reading the code the button is connected to pin 26, the other side probably is connected to +5V. Although this might work, it is good practice to also connect a resistor (like 10kOhm) between pin 26 and ground, to ensure pin 26 is at 0V when the button is NOT pushed.
-
@Peter-Peters Logic voltage on the Omega is 2.8V. So the other side should be connected to 2.8V.
-
Woops, my bad.., but in that case the picture also shows the wrong connection...
What do you actually mean by 'logic voltage'? Is that the level where a '1' is detected or
the max input voltage for digital inputs?So which of other 3 possible pins is the right one then? 2V, 2.5V, or 3V?
Or maybe the Onion Omega has a similar 'internal pullup' construct like the Arduino? In that
case you just change the circuit such that the button pulls 'down'.
-
@Peter-Peters Well, other voltages should work as well. Anything over 1.5V should be recognized by the Omega as a 1. You should be using the 2.5V.
-
@Boken-Lin posted GPIO8 is for on board LED:
https://community.onion.io/topic/360/0-0-5-b251-gpio8-vs-others/2
-
An update from the Onion side of things: we recently released an OnionGpio python module that can be installed via opkg.
Check it out here: https://wiki.onion.io/Documentation/Libraries/GPIO-Library
-
@Lazar-Demin , I want to use GPIO interrupt driven and I would love to see a python implementation. can you put some light on it.
-
@srikrishna-Acharya In case it is of any use to you, GPIO interrupt handling is covered in the package that I produced that is available at https://github.com/KitBishop/Omega-GPIO-I2C-Arduino
While there is nothing specifically Python related, the
gpioirq
program that is part of this package (at https://github.com/KitBishop/Omega-GPIO-I2C-Arduino/tree/master/gpioirq) is capable of running any command on interrupt on any selected GPIO pin. This would include executing any suitable Python script on interrupt.