Author Topic: encodeur and attachInterrupt()  (Read 332 times)

fr

  • Newbie
  • *
  • Posts: 19
encodeur and attachInterrupt()
« on: March 25, 2021, 10:43:58 am »
Good morning all,

I took out an old digispark to ask it to manage a small motor with a quadrature encoder, the motor is driven by an MX1508.
I want to keep P1 for its internal led, not touch P5 for now.

I still have P0 and P2 to put the hall sensors of the encoder and to use attachInterrupt (0, ... P2 is perfect but P3 and P4 are activated at the initialization of the digispark and then by the bootloader and therefore my engine starts in motion: annoying ...

The driver on P0 and P2: perfect BUT how to order an interrupt on P3 or P4? (solution that I would like the most!)
Or if P2 perfectly controls the interruption, how can motor movements be prevented at the start?