Coder Social home page Coder Social logo

keyboardproxy's Introduction

KeyboardProxy

Enables sending keyboard input for Arduino Uno and earlier boards using Processing as a proxy.

Setup

  1. Open the .pde file in Processing
  2. Run the Processing Sketch
  3. Watch the Processing console: it will display a list of available serial ports
  4. Adjust the setup() function in the Processing sketch to connect to the right port from the list

Usage

  1. Run the Processing sketch
  2. Click in the application window to enable the keyboard proxy
  3. Make sure the application you want to control is in the foreground and is the selected window

Arduino code

You can use the Serial library to send keyboard commands to the Processing sketch. The following keys are supported:

  1. "A" till "Z" and "0" till "9"
  2. "<" and ">" equal the left and right arrow key
  3. "^" and "." equal the up and down arrow key
  4. "_" equals the spacebar

Example code for Arduino:

The following code checks an analog sensor at pin A0 and sends a "_" character to the computer if the measured value is greater than 300, resulting in a emulated press on the spacebar.

int sensorPin = A0;
int prevValue = 0;

void setup() {
    Serial.begin(9600);
}

void loop() {
    int value = analogRead(sensorPin);
    if (value > 300 && prevValue <= 300) {
        Serial.write("_");
    }
    prevValue = value;
}

keyboardproxy's People

Contributors

vijnv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.