DexterInd / DexterInd/GrovePi

Pinchange interrupts could do with tidying up

Open
#322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
494
Forks
472
PR merge metrics
No merged PRs in 30d

Description

There are several things that use (or probably should use) pinchange interrupts;

dust sensor,
flow sensor
encoder
ultrasonic read

They currently use a mix of polling, global pinchange PCINT2_vect, and pinchange on one pin (which only works on port 8). It would make sense for them all to sit on the global pinchange interrupts,
PCINT2_vect & PCINT0_vect . I would suggest we use the https://github.com/GreyGnome/EnableInterrupt library, as that does all the pinchange for all pins magic and would make it quite easy to translate the existing code.

I can't fix this because I don't have dust sensor, encoder or flow sensor to test with.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the dust sensor, flow sensor, encoder, and ultrasonic-read implementations, then compare their polling, global PCINT2_vect, and single-pin interrupt paths. Review the suggested EnableInterrupt library and determine how all four should use PCINT2_vect and PCINT0_vect; done means the implementations are consolidated and verified with the available sensor hardware.

Written by the indexing model from the issue text.

Assessment

Tech stack
raspberry-pi
Domain
embedded-iot
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.