Python Forum
Stop/continue While loop block
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop/continue While loop block
#40
Quote:But to get this, trellis.sync in the While loop reads all 32 boards each time. I was wondering if that could be avoided

I2C is a serial ( asynchronous ) bus, thus only one packet can be seen (or set) at any one time. A separate packet is put on the bus, with it's board Id each time an event occurs, and then is identified and read on the receiving end of the connection. I can't explain all here, but the specification here will explain all (the last release of specs was released, April 4, 2014 so don't let the date make you think that it's outdated. And is further explained here.

Putting stuff on the bus is the work of the sending hardware and/or software.
I'm guessing the following: (I have only previous real-life job experience and know how I handled this in the past)

The logical choice for setup is:

1. Poll each board individually, ( in software ) looking for a signal. This obviously has to be done fast enough to be able to detect each key press, no matter where it originates.
The polling speed is limited by the hardware on each neotrellis board, Not by the controlling processor, no matter how fast it is, so the pi zero (or any other processor, like the M4, is more than adequate A button can only physically be pressed as fast as a human finger can move).

2. Each individual board on the neotrellis fires an interrupt as soon as [b]Any[/] key is pressed on that board. This interrupt along with the board Id and x, y id is immediatly sent over the I2c bus to the controlling processor. This is the ideal setup as you don't have to discover which board is sending the button press signal. Again the time needed to process on the controlling processor is trivial when human intervention (the button press) is involved.

External processing is necessary to handle this (with a single I2c from all boards) to MCU. see: https://learn.adafruit.com/adafruit-neot...-3002700-9.

Any code, no matter what is used, can only send one packet at a time across the I2C bus. If more than one finger is used at the same time, It would be possible to have collisions (bounce) that must be taken into consideration with either de-bounce software or hardware. I'm not ready to say what is being done on this board yet. I will get to it, but as stated before, slowly (I have to fit this into my schedule, which, although being retired, is quite full).

That's why I warn that above is still speculation.
Reply


Messages In This Thread
Stop/continue While loop block - by Moris526 - Jan-02-2021, 09:54 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-02-2021, 12:30 PM
RE: Stop/continue While loop block - by Moris526 - Jan-02-2021, 11:35 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-03-2021, 12:22 AM
RE: Stop/continue While loop block - by Moris526 - Jan-03-2021, 12:30 AM
RE: Stop/continue While loop block - by Moris526 - Jan-03-2021, 01:06 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-03-2021, 11:23 AM
RE: Stop/continue While loop block - by Moris526 - Jan-03-2021, 01:37 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-03-2021, 04:33 PM
RE: Stop/continue While loop block - by Moris526 - Jan-04-2021, 01:08 AM
RE: Stop/continue While loop block - by bowlofred - Jan-04-2021, 01:15 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-04-2021, 02:05 AM
RE: Stop/continue While loop block - by Moris526 - Jan-04-2021, 02:28 AM
RE: Stop/continue While loop block - by Moris526 - Jan-04-2021, 02:39 AM
RE: Stop/continue While loop block - by Moris526 - Jan-04-2021, 07:29 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-04-2021, 10:05 AM
RE: Stop/continue While loop block - by Moris526 - Jan-05-2021, 02:21 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-05-2021, 08:01 PM
RE: Stop/continue While loop block - by Moris526 - Jan-06-2021, 06:58 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-06-2021, 10:44 AM
RE: Stop/continue While loop block - by Moris526 - Jan-06-2021, 11:07 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-06-2021, 11:45 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-09-2021, 05:51 AM
RE: Stop/continue While loop block - by Moris526 - Jan-09-2021, 06:58 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-11-2021, 04:00 PM
RE: Stop/continue While loop block - by Moris526 - Jan-11-2021, 08:02 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-11-2021, 10:53 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-13-2021, 03:34 AM
RE: Stop/continue While loop block - by Moris526 - Jan-13-2021, 08:14 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-14-2021, 09:10 PM
RE: Stop/continue While loop block - by Moris526 - Jan-15-2021, 10:01 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-15-2021, 12:48 PM
RE: Stop/continue While loop block - by Moris526 - Jan-15-2021, 06:18 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-15-2021, 10:18 PM
RE: Stop/continue While loop block - by Moris526 - Jan-16-2021, 03:16 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-16-2021, 05:35 PM
RE: Stop/continue While loop block - by Moris526 - Jan-17-2021, 09:25 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-17-2021, 07:05 PM
RE: Stop/continue While loop block - by Moris526 - Jan-18-2021, 01:02 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-18-2021, 05:11 PM
RE: Stop/continue While loop block - by Moris526 - Jan-18-2021, 10:03 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-18-2021, 11:59 PM
RE: Stop/continue While loop block - by Moris526 - Jan-19-2021, 10:58 AM
RE: Stop/continue While loop block - by Larz60+ - Jan-23-2021, 03:00 AM
RE: Stop/continue While loop block - by Moris526 - Jan-23-2021, 10:56 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-23-2021, 11:12 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-24-2021, 09:41 PM
RE: Stop/continue While loop block - by Moris526 - Jan-24-2021, 10:25 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-24-2021, 11:47 PM
RE: Stop/continue While loop block - by Moris526 - Jan-25-2021, 01:37 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-25-2021, 01:44 PM
RE: Stop/continue While loop block - by Moris526 - Jan-25-2021, 07:02 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-26-2021, 01:14 AM
RE: Stop/continue While loop block - by nilamo - Jan-26-2021, 06:41 PM
RE: Stop/continue While loop block - by Larz60+ - Jan-26-2021, 07:57 PM
RE: Stop/continue While loop block - by Moris526 - Jan-27-2021, 12:42 AM
RE: Stop/continue While loop block - by Larz60+ - Feb-01-2021, 10:36 AM
RE: Stop/continue While loop block - by Moris526 - Feb-01-2021, 08:11 PM
RE: Stop/continue While loop block - by Moris526 - Feb-09-2021, 11:23 PM
RE: Stop/continue While loop block - by Larz60+ - Feb-09-2021, 11:28 PM
RE: Stop/continue While loop block - by Moris526 - Feb-10-2021, 03:10 PM
RE: Stop/continue While loop block - by Moris526 - Mar-01-2021, 08:24 PM
RE: Stop/continue While loop block - by Larz60+ - Mar-01-2021, 09:45 PM
RE: Stop/continue While loop block - by Moris526 - Mar-24-2021, 06:29 PM
RE: Stop/continue While loop block - by Larz60+ - Mar-24-2021, 07:04 PM
RE: Stop/continue While loop block - by Moris526 - Mar-26-2021, 12:20 AM
RE: Stop/continue While loop block - by Larz60+ - Mar-26-2021, 01:32 AM
RE: Stop/continue While loop block - by Moris526 - Mar-28-2021, 04:13 PM
RE: Stop/continue While loop block - by Larz60+ - Mar-28-2021, 09:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Anyway to stop a thread and continue it? dimidgen 2 449 Mar-18-2024, 10:53 AM
Last Post: DeaD_EyE
  Button to stop while loop from another script Absolutewind 5 1,056 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  get out of while loop and stop repeat Frankduc 11 3,192 Apr-26-2022, 10:09 PM
Last Post: deanhystad
  while loop will not stop looping TheTechRobo 5 3,885 Apr-20-2020, 01:47 PM
Last Post: TheTechRobo
  for loop stumbling block YoungGrassHopper 8 4,765 Sep-11-2019, 03:34 PM
Last Post: YoungGrassHopper
  while loop stumbling block YoungGrassHopper 5 3,458 Sep-09-2019, 08:36 PM
Last Post: YoungGrassHopper
  How to continue in loop until correct input received sunnyarora 10 10,197 May-04-2019, 02:37 PM
Last Post: Yoriz
  Can I Control loop with Keyboad key (start/stop) Lyperion 2 3,454 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,993 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