Skip to content

Instantly share code, notes, and snippets.

// Print the Key packet
// DPad
Serial.print("K:");
Serial.print(digitalRead(RIGHT));
Serial.print(digitalRead(UP));
Serial.print(digitalRead(LEFT));
Serial.print(digitalRead(DOWN));
// Action buttons
Serial.print(digitalRead(A));
// Set the DPad buttons to pullup inputs
pinMode(RIGHT, INPUT_PULLUP);
pinMode(UP, INPUT_PULLUP);
pinMode(LEFT, INPUT_PULLUP);
pinMode(DOWN, INPUT_PULLUP);
// Set the action buttons to pullup inputs
pinMode(A, INPUT_PULLUP);
pinMode(B, INPUT_PULLUP);
pinMode(X, INPUT_PULLUP);
@kelliott121
kelliott121 / ControllerTestFirmware0.ino
Created May 2, 2017 17:02
Controller Test Firmware 0
enum DPad {RIGHT = 2, UP = 3, LEFT = 4, DOWN = 5};
enum Buttons {A = 6, B = 7, X = 8, Y = 9};
@kelliott121
kelliott121 / BluetoothTest.ino
Created May 2, 2017 16:59
Test of Controller Firmware for PiGRRL Switch
enum DPad {RIGHT = 2, UP = 3, LEFT = 4, DOWN = 5};
enum Buttons {A = 6, B = 7, X = 8, Y = 9};
void setup() {
// Set the DPad buttons to pullup inputs
pinMode(RIGHT, INPUT_PULLUP);
pinMode(UP, INPUT_PULLUP);
pinMode(LEFT, INPUT_PULLUP);
pinMode(DOWN, INPUT_PULLUP);
@kelliott121
kelliott121 / ControllerServer.py
Created April 28, 2017 16:53
ControllerServer.py v0
import serial
from uinput import *
class Controller:
"""docstring for Controller"""
NumButtons = 8
def __init__(self, devName, devKeys):
self.devPath = "/dev/" + devName
@kelliott121
kelliott121 / timeslice.ino
Last active January 16, 2017 18:00
Timeslice Architecture
uint16_t TimeSlice = 0;
uint16_t TimeSlicePrevious = (uint16_t) - 1;
void loop()
{
// Record the beginning of the timeslice
uint32_t startTime = micros();
// Update the current timeslice
TimeSlicePrevious = TimeSlice;
package its.view;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
public class GUIWindow extends JFrame{
private static final long serialVersionUID = 4159491956760989038L;
private static final double VERSION = 0.1;