Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • PieterP's Avatar
    11-22-2020, 05:47 PM
    Don't bother with the powf and pow C functions, use the C++ function std::pow from the <cmath> header, it'll always select the right version: double if the arguments are doubles, float if the arguments are floats. ...
    7 replies | 201 view(s)
  • PieterP's Avatar
    11-19-2020, 01:49 PM
    Basically it just reads the states of all the pins, and for each pair of pins, it compares them to the previous states. This is done by combining the two new states and the two old states as a 4-bit number: "new state B...
    8 replies | 172 view(s)
  • PieterP's Avatar
    11-19-2020, 12:38 PM
    Here's what I use: https://github.com/tttapa/Arduino-Helpers/blob/master/src/AH/Hardware/MCP23017Encoders.hpp See this example:...
    8 replies | 172 view(s)
  • PieterP's Avatar
    11-19-2020, 08:47 AM
    I see you've edited your reply, glad you got it working. If you have multiple chips, you could tie all of their interrupt pins together (use open-drain output on the MCPs and input pull-up enabled on the Teensy)....
    8 replies | 172 view(s)
  • PieterP's Avatar
    11-19-2020, 08:36 AM
    When a pin of the MCP changes state, the interrupt output goes low. This should trigger an interrupt on the Teensy. In the ISR, you read the MCP input register, and this read request causes the MPC to make the interrupt...
    8 replies | 172 view(s)
  • PieterP's Avatar
    11-18-2020, 10:29 PM
    The MCP will keep the interrupt pin low until you read the input register of the port that caused the interrupt, so you have to read the data in your ISR. This also implies that the correct interrupt mode is LOW, not...
    8 replies | 172 view(s)
  • PieterP's Avatar
    11-02-2020, 06:08 PM
    A latency of 27ms doesn't seem right at all. I'm not familiar with the Adafruit libraries you mention, but I did write a MIDI BLE library for ESP32. The way I handle it there is by buffering the Bluetooth packets,...
    4 replies | 182 view(s)
  • PieterP's Avatar
    11-02-2020, 04:52 PM
    What exactly do you need a queue for? Usually, you want to keep the latency as low as possible, so you'd avoid queuing up any MIDI data. The serial port or USB MIDI code you're using already has its own queue, for both...
    4 replies | 182 view(s)
No More Results
About PieterP

Basic Information

Statistics


Total Posts
Total Posts
27
Posts Per Day
0.03
Last Post
pow() function alternative 11-22-2020 05:47 PM
General Information
Last Activity
Yesterday 11:45 PM
Join Date
09-10-2018