Arnov Sharma
Published © MIT

Pico Macropad

Made a Macropad using Raspberry Pi RP2040 and custom PCB

BeginnerFull instructions provided1 hour726

Things used in this project

Hardware components

Raspberry Pi Pico
Raspberry Pi Pico
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1

Software apps and online services

Fusion
Autodesk Fusion

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Fusion360File

Schematics

sch

Code

code

C/C++
#include <Keyboard.h>
int buttonPin0 = 0;  // Set a button to any pin
int buttonPin1 = 1;  // Set a button to any pin
int buttonPin2 = 2;  // Set a button to any pin
int buttonPin3 = 3;  // Set a button to any pin
int buttonPin4 = 4;  // Set a button to any pin
int buttonPin5 = 5;  // Set a button to any pin

void setup()
{
  pinMode(buttonPin0, INPUT_PULLUP);  
  pinMode(buttonPin1, INPUT_PULLUP); 
  pinMode(buttonPin2, INPUT_PULLUP); 
  pinMode(buttonPin3, INPUT_PULLUP); 
  pinMode(buttonPin4, INPUT_PULLUP); 
  pinMode(buttonPin5, INPUT_PULLUP); 
  digitalWrite(buttonPin0, HIGH);  
  digitalWrite(buttonPin1, HIGH); 
  digitalWrite(buttonPin2, HIGH); 
  digitalWrite(buttonPin3, HIGH); 
  digitalWrite(buttonPin4, HIGH); 
  digitalWrite(buttonPin5, HIGH); 
}

void loop()
{
  if (digitalRead(buttonPin0) == 0)  // if the button goes low
  {
    Keyboard.write('q');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
  if (digitalRead(buttonPin1) == 0)  // if the button goes low
  {
    Keyboard.write('w');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
    if (digitalRead(buttonPin2) == 0)  // if the button goes low
  {
    Keyboard.write('e');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
    if (digitalRead(buttonPin3) == 0)  // if the button goes low
  {
    Keyboard.write('a');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
    if (digitalRead(buttonPin4) == 0)  // if the button goes low
  {
    Keyboard.write('s');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
    if (digitalRead(buttonPin5) == 0)  // if the button goes low
  {
    Keyboard.write('d');  // send a 'z' to the computer via Keyboard HID
    delay(1);  // delay so there aren't a kajillion z's
  }
}

Credits

Arnov Sharma
320 projects • 327 followers
Just your average MAKER
Contact

Comments

Please log in or sign up to comment.