Go to advanced search

by MisterYsLab
Sat Apr 13, 2019 11:39 pm
Forum: Python
Topic: How to detect multiples buttons simultaneously to play a chord
Replies: 2
Views: 245

Re: How to detect multiples buttons simultaneously to play a chord

I substituted the pigpio library for Rpi.GPIO since I am much more familiar with pigpio. Before executing this code, you must start the pigpio daemon sudo pigpiod Here is the code. I am using LEDs to simulate tone A, B and the mix of tones. # remember to start pigpio - sudo pigpiod import pigpio imp...
by MisterYsLab
Fri Apr 12, 2019 2:11 pm
Forum: Python
Topic: Button Behaviour Help
Replies: 1
Views: 182

Re: Button Behaviour Help

It is a little difficult to understand the behavior you are trying to achieve from your description, but here is some code that I think achieves what you are trying to do. I ran this on a Pibrella for test and that is why I set pull_up to False for the switch. import gpiozero as GP import time # est...
by MisterYsLab
Sat Apr 06, 2019 1:42 pm
Forum: Python
Topic: Unable to install pyzmq and RPi.GPIO from requirements.txt
Replies: 3
Views: 634

Re: Unable to install pyzmq and RPi.GPIO from requirements.txt

To see available wheels go to https://www.piwheels.org.

In a virtualenv install the latest versions of both packages using pip, remove both from the requirements list and reinstall.
by MisterYsLab
Sun Nov 25, 2018 2:55 am
Forum: Python
Topic: GUI not appearing (Guizero)
Replies: 7
Views: 1075

Re: GUI not appearing (Guizero)

I ran this on on Ubuntu box. I will run on an RPi tomorrow and will get back to you.
by MisterYsLab
Sat Nov 17, 2018 8:31 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1633

Re: Accessing IO in new class

You can organize your classes anyway that makes sense to you. Here I modified the program to handle a button push in the motor and pressure sensor classes. Both are simultaneously listening for a button press on the same pin. I am using a pigio callback that will fire on a rising edge for one class ...
by MisterYsLab
Sat Nov 17, 2018 7:26 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1633

Re: Accessing IO in new class

import pigpio class PressureSensor: def __init__(self): self.pi = pigpio.pi() # add the rest of your class here class Motors: def __init__(self): self.pi = pigpio.pi() # add the rest of your class here # import PressureSensor # import Motors import time class MyApp: def __init__(self): ps = Pressur...
by MisterYsLab
Thu Oct 11, 2018 8:37 pm
Forum: Python
Topic: Program GPIO pin to execute a script in the terminal after receiving external trigger
Replies: 3
Views: 645

Re: Program GPIO pin to execute a script in the terminal after receiving external trigger

Glad to help. Since Popen can be difficult to understand, here is a short program example demonstrating its use. Here I am opening xeyes passing it a parameter. I print out the process ID. I wait 2 seconds and then kill the xeyes. #!/usr/bin/env python3 import subprocess from subprocess import Popen...
by MisterYsLab
Fri Sep 30, 2016 4:50 pm
Forum: Troubleshooting
Topic: RPi incredibly slow after Pixel upgrade
Replies: 17
Views: 4165

Re: RPi incredibly slow after Pixel upgrade

Problem resolved for me.

I just reloaded my sd card. This time I used 7zip as suggested and a different card. All is well now, so I am not sure if the original unzip caused the issue or the sd card I used.
by MisterYsLab
Fri Sep 30, 2016 3:56 pm
Forum: Troubleshooting
Topic: RPi incredibly slow after Pixel upgrade
Replies: 17
Views: 4165

Re: RPi incredibly slow after Pixel upgrade

I agree boot and shutdown times are insanely slow. I opened up chromium and CPU utilization on the desktop went to 100% and then chromium crashed. I am going back to the previous release.
by MisterYsLab
Mon Dec 15, 2014 7:25 pm
Forum: Other programming languages
Topic: Snap! - can we get it to run on the RPi
Replies: 15
Views: 12360

Re: Snap! - can we get it to run on the RPi

Xi https://github.com/MrYsLab/xi works well controlling the GPIO pins using Snap! or Scratch 2.0. The current release supports digital in and digital out. We will be testing PWM and Servo in the next few days.

Go to advanced search