Toy Keyboard integration of expanders #60
Replies: 3 comments 2 replies
-
Threw an OLED on the SPI bus ... working no problem. I call the setup and display.display(); from Task0. I call the write to screen memory from various modules. This avoids audio artifacts. |
Beta Was this translation helpful? Give feedback.
-
Well I've read that it transfers data held in ram when you call that and
that made sense with offloading to task0 to prevent audio glitches. It's so
simplistic that I don't think the screen has a frame buffer to preload but
I could be wrong. So the library creates its own framebuffer in effect.
…On Tue, Aug 3, 2021, 00:27 Marcel ***@***.***> wrote:
Does display.display() transfer the data to display or just initiates to
display data from the OLED's internal buffer?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALTDOQ3DI4PPEST5SC7YMJDT23IPVANCNFSM5BDYYYQQ>
.
|
Beta Was this translation helpful? Give feedback.
-
This project is moving along as a fork of basic synth. I've made my own knobs, banks of parameters physical interface in this self contained unit. I am milking this for all I can to develop something I have a good deal of control. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If anyone is hacking keyboards on the cheap i've done 2 so far. So I wanted to put this info here in case its interesting to anyone.
Then I wanted to have an ESP32 with the matrix so it's an all in one - no midi necessary. So this is where seeing a video of Marcel using GPIO expanders such as MCP23017 was a good clue. I bought them and wired up one - tested and working.
I had already tested the matrix direct to pins of another arduino keypad.h library. I then had a bit of a palava figuring out how to use MCP23017 pins. The library of Adafruit is great but ... well it wasn't working out with this keyboard - i forked adafruit_keypad.cpp and wrote in calls for pins over 100 to call MCP23017 gpio pins via it's library. I passed a pointer to the MCP object using adafruit_mcp32017.h calls. The code worked but the keypad code wasn't working like the arduino keypad.h library had.
Then I had a whole issue about is this diodes missing and ghosting because any key of any row would trigger the whole row.
I found some libraries designed properly for doing this: (this is what I want to document)
https://github.com/joeyoung/arduino_keypads the keypad_mc17 (or other variations of IO expansions) are handled. It works, it also does multi-key so I can press several at once - seems to work well so far.
Now I'm integrating as many devices into this toy - a screen, pots (and another analogue port expander). I've soldered together something that is working. The only sadness was that my I2s dac board seems DOA. I have this other one that is fine with the prototype and I don't want to touch it since it's my only working one.
My goal is also to add a conventional midi out plug to this esp so I have something that drives that.
Its good to have this thown into your code so you can find out if its showing up on the SPI bus. That it's address is right - you'll need to set the address for the
#define I2CADDR 0x20 // address of MCP23017 chip on I2C bus
This scan will check that you see the device and it's address is confirmed for your code. I will have another SPI device or two going on like the screen so I'll need to avoid address conflicts. I also set 4.7k ohm resistors to pull up the SPI clock and data lines - you should only do this once for the bus. This will improve communication performance.
Beta Was this translation helpful? Give feedback.
All reactions