View gist:6258873
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
View timeslice.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
View ControllerServer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
from uinput import * | |
class Controller: | |
"""docstring for Controller""" | |
NumButtons = 8 | |
def __init__(self, devName, devKeys): | |
self.devPath = "/dev/" + devName |
View BluetoothTest.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
View ControllerTestFirmware0.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DPad {RIGHT = 2, UP = 3, LEFT = 4, DOWN = 5}; | |
enum Buttons {A = 6, B = 7, X = 8, Y = 9}; |
View ControllerTestFirmware1.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
View ControllerTestFirmware2.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); |
View ControllerTestFirmware3.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delay(10); |
View ControllerServer0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller: | |
"""docstring for Controller""" | |
NumButtons = 8 | |
def __init__(self, devName, devKeys): | |
self.devPath = "/dev/" + devName | |
try: | |
print "Connecting to " + self.devPath | |
self.serial = serial.Serial(self.devPath, 9600, timeout=10) |
View ControllerServer1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValidKeys = [ KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, | |
KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, | |
KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z,] |
OlderNewer