Skip to content

Instantly share code, notes, and snippets.

@kitschpatrol
Created April 12, 2011 03:43
Show Gist options
  • Save kitschpatrol/914875 to your computer and use it in GitHub Desktop.
Save kitschpatrol/914875 to your computer and use it in GitHub Desktop.
/*
* controlPanel.h
* vhsCannon
*
* Created by Eric Mika on 12/13/10.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "ofMain.h"
// Serial
#define PACKET_SIZE 7
class controlPanel {
public:
controlPanel();
void update();
void start();
// incoming
bool aPressed;
bool aDown;
bool aReleased;
bool bPressed;
bool bDown;
bool bReleased;
bool cPressed;
bool cDown;
bool cReleased;
bool dPressed;
bool dDown;
bool dReleased;
bool toggle1;
bool toggle2;
int mixSlider;
int micSlider;
int vhsSlider;
float mappedMixSlider;
float mappedMicSlider;
float mappedVhsSlider;
float masterVolume;
int ageOfDeath;
int pot1;
int pot2;
int encoderPosition;
// outgoing
int micLevel;
int vhsLevel;
int mixLevel;
private:
int bytesReceived;
ofSerial serial;
unsigned char packet[PACKET_SIZE];
void updateSerial();
void requestPacket();
void parsePacket();
int getBit(unsigned char data, int i);
unsigned char buttons;
bool aWasDown;
bool bWasDown;
bool cWasDown;
bool dWasDown;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment