Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button on robot frame needs a function #5

Open
kristinellis opened this issue May 6, 2019 · 3 comments
Open

Button on robot frame needs a function #5

kristinellis opened this issue May 6, 2019 · 3 comments
Labels
advanced This is a tough one enhancement New feature or request mozsprint software This issue is software-related

Comments

@kristinellis
Copy link
Contributor

kristinellis commented May 6, 2019

Overview

This is the button. There are many buttons like it, but this one is ours.

20190506_151525

The button is lovely and glowy and blue... and currently doesn't do anything when pressed.
Linked to this issue in our software repo.

Behavior

Current behavior: Nothing!
Desired behavior: Something!

Suggested things to do:

  • Make it play music! 🎶
  • Make the colors change! 🌈
  • Try your hand at the suggested fix in the linked issue
@kristinellis kristinellis added mozsprint advanced This is a tough one software This issue is software-related labels May 6, 2019
@btmorr
Copy link

btmorr commented May 6, 2019

Notes to anyone who wants to work with The Button. The button is wired up to the GPIO pins of the RaspberryPi, so you can poll the associated pin's value to see if the button is currently pressed or not.

The relevant library source code is here: https://github.com/Opentrons/opentrons/blob/edge/api/src/opentrons/drivers/rpi_drivers/gpio.py

You can import and check it in your code using:

from opentrons.drivers.rpi_drivers import gpio

while True:
  if gpio.read(gpio.INPUT_PINS['BUTTON_INPUT']):
    print('The button is currently being pushed!')

The above code will print as fast as possible over and over as long as the button is pushed, which is probably not what you want to do. Replace the print statement with something more interesting, and remember that the loop will keep going, so make it behave sanely (or a fun kind of insanely) if the button is held down!

@kristinellis kristinellis added the enhancement New feature or request label May 6, 2019
@kristinellis
Copy link
Contributor Author

@theosanderson proposes what I think is an ideal way to implement this feature: Disco Bot v 1.0

@MarcelRobitaille
Copy link

Does this still work? Looks like there's a class there now. Does initializing it hurt anything? What is chip_name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced This is a tough one enhancement New feature or request mozsprint software This issue is software-related
Projects
None yet
Development

No branches or pull requests

3 participants