Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Robotics EveryDay
Published © GPL3+

Hands-Free ; Semicolon Button Helps Code Faster, Arduino MKR

This is a big Foot Switch/Button that can add semicolons; wherever the cursor is. It can be controlled by leg/foot. So hands are free.

BeginnerFull instructions provided168
Hands-Free ; Semicolon Button Helps Code Faster, Arduino MKR

Things used in this project

Hardware components

Arduino MKR GSM 1400
Arduino MKR GSM 1400
×1
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
×1
Foot Operated Switch, (On)
Foot Operated Switch, (On)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Footswitch for ; & dino Schematic

Please Ignore the Schematic. It is just for illustration. The connections of the push-button are not correct.

Code

Code for Footswitch for Semicolon & Dino

Arduino
Code for Footswitch for Semicolon & Dino
//code for ; semicolon from foot
#include <Keyboard.h>

void setup() {
  pinMode(3,INPUT);       //switch connected to digital pin 3
  Keyboard.begin(); 
}

void loop() {
  
  int v = digitalRead(3); // read the state at digital pin 3
  
  if (v == LOW){          // if digital pin 3 is low
    
    Keyboard.print(";");  //then print ; semicolon
    
    delay(25);            
  
  }
}

//Code for chrome dino, up arrow key
#include <Keyboard.h>

void setup() {
  pinMode(3,INPUT);       //switch connected to digital pin 3
  Keyboard.begin(); 
}

void loop() {
  
  int v = digitalRead(3); // read the state at digital pin 3
  
  if (v == LOW){          // if digital pin 3 is low
    
    Keyboard.press(KEY_UP_ARROW); //then press up arrow key
    Keyboard.releaseAll();        // release the pressed key
    
    delay(25);            
  
  }
}

Credits

Robotics EveryDay
3 projects • 9 followers

Comments