Close

Even More Magical Tiles

A project log for A Tile Based MacroPad

Using "magic" tiles to assign keystrokes to this MacroPad's keys.

michael-gardiMichael Gardi 10/02/2023 at 21:590 Comments

When doing the firmware I ended up deciding that the encoded tile number would be used as an index into the macros table of macro strings. But because each of the two digits in a tile could only go up to 8, it meant that the macro table ended up having gaps marked "Skip for now.".

 // Define the macros here.
String macros[] = {
  "PRESS,KEY_LEFT_CTRL,a,RELEASE_ALL", // select
  "PRESS,KEY_LEFT_CTRL,c,RELEASE_ALL", // copy
  "PRESS,KEY_LEFT_CTRL,x,RELEASE_ALL", // cut
  "PRESS,KEY_LEFT_CTRL,v,RELEASE_ALL", // paste
  "KEY_UP_ARROW",                      // up
  "KEY_LEFT_ARROW",                    // left
  "KEY_RIGHT_ARROW",                   // right
  "KEY_DOWN_ARROW",                    // down
  "",                                  // Skip for now.
  "",                                  // Skip for now.
  "MEDIA_VOLUME_UP",                   // louder 
  "MEDIA_VOLUME_DOWN",                 // softer
  "MEDIA_MUTE",                        // mute
  "MEDIA_PLAY_PAUSE",                  // pause/play
  ""
};

No big deal but also easily fixed. I decide to add another magnet holder to the mix which would allow two more numbers per tile side. 

When looking at the readings from one side of an existing tile:

 136, 72, 54, 37, -123, -87, -56, -37

you can see that there is a pretty big "gap" between the first two numbers and the fifth and six numbers.  This represents the difference in distance from the sensor between 0 mm and 1 mm.  So I added another magnet holder with the distance set to .6 mm. Here is my new set of holders:

 With ten digits per magnet, I can now have up to 100 macros stored, and no gaps in the macros table. 

Discussions