Python Forum
Stop/continue While loop block
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop/continue While loop block
#11
interrupt_enabled isn't a method, so you don't call it (you don't use parentheses).

Try instead:

while True:
 
     if trellis.interrupt_enabled == True:
 
        print("test")
 
     else:
        trellis.sync()
        time.sleep(0.02)
Larz60+ likes this post
Reply
#12
bowlofred is correct, but if you are truly using interrupts, you shouldn't need (nor want) any sleep time.

I'm intrigued by this device and have ordered one. If you haven't figured it out by the time I receive one, I'll let you know how to make it work.
Reply
#13
Here is a tribe of Neotrellis builders

https://llllllll.co/t/diy-monome-compati...llis/28106
Larz60+ likes this post
Reply
#14
I try:

while True:
  
     if trellis.interrupt_enabled == True:
  
        print("test")
  
     else:
        trellis.sync()
        time.sleep(0.02)
Now I get no error. But not interrupt detected.

In the Adafruits page says that the GPIO pin is #5 by default https://learn.adafruit.com/adafruit-neot...ython-code

But shouldnt be there be indicated somewhere in the code? I cant find it.

Quote:If you haven't figured it out by the time I receive one, I'll let you know how to make it work.

Dance
Reply
#15
In my proyect I want to send data from Pc ( Max/MSP ) to Rasp to Neotrellis Board

If I get something like this

https://www.ebay.com/itm/USB-to-I2C-Modu...%3A2334524

Wouldnt it be better?
Reply
#16
Quote:If I get something like this

https://www.ebay.com/itm/USB-to-I2C-Modu...%3A2334524

Wouldn't it be better?

I think Yes. Good tool to have available at any rate, since price is so low.

Quote:No. This one.

https://learn.adafruit.com/adafruit-neotrellis?view=all

Is there anything else I will need?

if so, a Bill Of Materials would be nice to have.
Reply
#17
(Jan-04-2021, 10:05 AM)Larz60+ Wrote: Is there anything else I will need?

They sell you a case if you want.

And this cables are handy if you dont want to solder

https://www.adafruit.com/product/3568

https://www.adafruit.com/product/4045

For interrupt you have to solder a pin on the side.

They have a sample code both for Arduino and Rasp.

I think thats it.

If you want to build a more than one unit board, in the monome page theres is a video on how to do it with headers.
Reply
#18
Should have by Friday.

I also purchased Adafruit MCP2221A Breakout - General Purpose USB to GPIO ADC I2C board to convert i2c to USB-A
and (don't know if needed, but just in case) STEMMA QT / Qwiic JST SH 4-pin Cable which looks like it might be a different cable that the one ordered previously.

There's a video on how to use the converter (actually for a different project) here: https://www.youtube.com/watch?v=afOqJdf2...e=emb_logo
Reply
#19
Quote:Should have by Friday.
Dance


Quote:There's a video on how to use the converter (actually for a different project) here: https://www.youtube.com/watch?v=afOqJdf2...e=emb_logo

Intresting

Check out the last post on this Adafruit thread about interrupt with Python

https://forums.adafruit.com/viewtopic.php?f=50&t=173615
Reply
#20
Documents for MCP2221A:
The writeup on the Neotrellis board here: https://learn.adafruit.com/adafruit-neotrellis?view=all
states: These 4x4 button pad boards are fully tile-able and communicate over I2C. With 5 address pins, you've got the ability to connect up to 32 together in any arrangement you like. With our trusty seesaw I2C-to-anything chip, you don't even need to manage the NeoPixel driving. That's right! Both the button management and LED driving is completely handled for you all over plain I2C. With both Arduino/C++ and CircuitPython/Python library support, you can use these pads with any and all microcontroller or computer boards.

Documents for ATSAMD09D14A-MU:
The trusty seesaw I2C-to-anything chip can be seen here: https://learn.adafruit.com/adafruit-sees...9-breakout
it provides:
  • 3 x 12-bit ADC inputs
  • 3 x 8-bit PWM outputs
  • 7 x GPIO with selectable pullup or pulldown
  • 1 x NeoPixel output (up to 63 pixels)
  • 1 x EEPROM with 64 byte of NVM memory (handy for storing small access tokens or MAC addresses)
  • 1 x Interrupt output that can be triggered by any of the accessories
  • 2 x I2C address selection pins
  • 1 x Activity LED

Pinouts for seesaw: https://learn.adafruit.com/adafruit-sees...ut/pinouts

this should connect directly to the MCP2221A which should plug directly into USB-A port and be readable by python.
I will work out details when I have the hardware.

I wrote the code (In 'C', Not python) for the keypad on a well known commercial fish finder with a TI msp430 MCU and made it entirely interrupt driven. I still have that code if I need to fall back on it. It was written for any 4 x 4 matrix.

There should be no need for the raspberry pi.

Quote:Check out the last post on this Adafruit thread about interrupt with Python

https://forums.adafruit.com/viewtopic.php?f=50&t=173615

This doesn't worry me yet. I've done a lot of embedded hardware work, starting back in the early 1980's with the intel 8080A.
I think (won't swear to it yet) I can make it work
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Anyway to stop a thread and continue it? dimidgen 2 263 Mar-18-2024, 10:53 AM
Last Post: DeaD_EyE
  Button to stop while loop from another script Absolutewind 5 819 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  get out of while loop and stop repeat Frankduc 11 2,866 Apr-26-2022, 10:09 PM
Last Post: deanhystad
  while loop will not stop looping TheTechRobo 5 3,646 Apr-20-2020, 01:47 PM
Last Post: TheTechRobo
  for loop stumbling block YoungGrassHopper 8 4,439 Sep-11-2019, 03:34 PM
Last Post: YoungGrassHopper
  while loop stumbling block YoungGrassHopper 5 3,245 Sep-09-2019, 08:36 PM
Last Post: YoungGrassHopper
  How to continue in loop until correct input received sunnyarora 10 9,775 May-04-2019, 02:37 PM
Last Post: Yoriz
  Can I Control loop with Keyboad key (start/stop) Lyperion 2 3,270 Jul-28-2018, 10:19 AM
Last Post: Lyperion
  build a list (add_animals) using a while loop, stop adding when an empty string is en nikhilkumar 1 8,844 Jul-17-2017, 03:29 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020