Skip to content

jamosaur/jamo-9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

jamo-9

9 Key Macropad with rotary encoder

Specs

MCU: WCH CH552G

Pinout

+-------+-------+-------+
|       |       |       |
|   1   |   2   |   3   | Key number
|  3.0  |  3.1  |  1.7  | Pin number
+-------+-------+-------+
|       |       |       |
|   4   |   5   |   6   |
|  1.5  |  1.4  |  3.2  |
+-------+-------+-------+

ENC A: 3.4
ENC B: 3.3
ENC PUSH: 1.1

Setting up for use with Arduino IDE

https://github.com/DeqingSun/ch55xduino

Flashing instructions

Hold down the push button and plug into your computer!

Quick example

#ifndef USER_USB_RAM
#error "Require USB RAM. Go Tools > USB Setting and pick the 2nd option in the dropdown list"
#endif

#include "src/userUsbHidMediaKeyboard/USBHIDMediaKeyboard.h"

#define KEY_1 30 // Pin 3.0 -> 30 etc

bool key1ActiveState = false;
bool key1Active = false;

void setup() {
  // put your setup code here, to run once:
  USBInit();
}

void loop() {
  // Simple example to use button 1 as a play/pause button.
  // put your main code here, to run repeatedly:

  key1Active = !digitalRead(KEY_1);

  if (key1ActiveState != key1Active){
      key1ActiveState = key1Active;
      if (key1Active){
        Consumer_press(MEDIA_PLAY_PAUSE);
      }else{
        Consumer_release(MEDIA_PLAY_PAUSE);
      }
    }


  delay(50);

}

References

https://github.com/tobychui/4xMacropad | Some inspiration, userUsbHidMediaKeyboard folder is required from this project.

About

9 Key Macropad with rotary encoder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published