Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cfausn committed Aug 11, 2016
0 parents commit 0185fea
Show file tree
Hide file tree
Showing 3,674 changed files with 2,527,178 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OpenBCI_GUI/SavedData/OpenBCI-RAW-*
39 changes: 39 additions & 0 deletions Arduino Code/motorcycle_code/motorcycle_code.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
int togglePin = 8;
int forwPin = 9;
int prevPin = 10;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(togglePin, OUTPUT);
pinMode(forwPin, OUTPUT);
pinMode(prevPin, OUTPUT);

}

void loop() {
// put your main code here, to run repeatedly:

if(Serial.available() > 0){
char inChar = Serial.read();
if(inChar == 't'){
digitalWrite(togglePin, HIGH);
delay(10);
digitalWrite(togglePin, LOW);
delay(1000);
}
else if(inChar == 'f'){
digitalWrite(forwPin, HIGH);
delay(10);
digitalWrite(forwPin, LOW);
delay(1000);
}
else if(inChar == 'b'){
digitalWrite(prevPin, HIGH);
delay(10);
digitalWrite(prevPin, LOW);
delay(1000);
}
}

}
Binary file added CodeMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
303 changes: 303 additions & 0 deletions DRAFTS/ControlP5scrollableList-original/ControlP5scrollableList.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
/**
* ControlP5 ScrollableList
*
* replaces DropdownList and and ListBox.
* List can be scrolled by dragging the list or using the scroll-wheel.
*
* by Andreas Schlegel, 2014
* www.sojamo.de/libraries/controlp5
*
*/


import controlP5.*;
import java.util.*;

PFont[] _controlFonts = new PFont[5];
ControlFont[] controlFonts = new ControlFont[5];

ControlP5 cp5_GUI;
CColor cp5_colors;
color[] colors = new color[10];

void setup() {
textAlign(CENTER, BOTTOM);
size(400, 400);
cp5_GUI = new ControlP5(this);
_controlFonts[0] = createFont("Arial", 10, true);
_controlFonts[1] = createFont("Arial", 12, true);
_controlFonts[2] = createFont("Arial", 14, true);
_controlFonts[3] = createFont("Arial", 16, true);
_controlFonts[4] = createFont("Arial", 18, true);

for (int i = 0; i < controlFonts.length; i++) {
controlFonts[i] = new ControlFont(_controlFonts[i]);
}

List l = Arrays.asList("a", "b", "c", "d");
/* add a ScrollableList, by default it behaves like a DropdownList */

//colors to be sent to cp5_GUI
cp5_colors = new CColor();
cp5_colors.setActive(color(0, 0, 255));
cp5_colors.setForeground(color(0, 255, 0));
cp5_colors.setBackground(color(255, 0, 0));
cp5_colors.setCaptionLabel(color(255, 255, 0));
cp5_colors.setValueLabel(color(255, 0, 255));

cp5_GUI.setColor(cp5_colors);
cp5_GUI.setFont(controlFonts[1]);

//cp5_colors.setActive(color(0,255,255));
//cp5_colors.setActive(color(0,255,255));
//cp5_colors.setActive(color(0,255,255));
//cp5_colors.setActive(color(0,255,255));
//color1.



cp5_GUI.addScrollableList("dropdown")
.setPosition(100, 100)
.setSize(100, 100)
.setScrollSensitivity(0.0)
.setBarHeight(20)
.setItemHeight(20)
.addItems(l)
// .setType(ScrollableList.LIST) // currently supported DROPDOWN and LIST
;

cp5_GUI.getController("dropdown")
.getCaptionLabel()
//.setFont(controlFonts[0])
//.setSize(12)
.getStyle()
.setPaddingTop(4)
;
//cp5.getController("dropdown")
// .setColor(int(color(255,0,0)))
// ;
}

void draw() {
background(240);
}

void dropdown(int n) {
/* request the selected item based on index n */
println(n, cp5_GUI.get(ScrollableList.class, "dropdown").getItem(n));

/* here an item is stored as a Map with the following key-value pairs:
* name, the given name of the item
* text, the given text of the item by default the same as name
* value, the given value of the item, can be changed by using .getItem(n).put("value", "abc"); a value here is of type Object therefore can be anything
* color, the given color of the item, how to change, see below
* view, a customizable view, is of type CDrawable
*/

CColor c = new CColor();
c.setBackground(color(255, 0, 0));
cp5_GUI.get(ScrollableList.class, "dropdown").getItem(n).put("color", c);
}

void keyPressed() {
switch(key) {
case('1'):
/* make the ScrollableList behave like a ListBox */
cp5_GUI.get(ScrollableList.class, "dropdown").setType(ControlP5.LIST);
break;
case('2'):
/* make the ScrollableList behave like a DropdownList */
cp5_GUI.get(ScrollableList.class, "dropdown").setType(ControlP5.DROPDOWN);
break;
case('3'):
/*change content of the ScrollableList */
List l = Arrays.asList("a-1", "b-1", "c-1", "d-1", "e-1", "f-1", "g-1", "h-1", "i-1", "j-1", "k-1");
cp5_GUI.get(ScrollableList.class, "dropdown").setItems(l);
break;
case('4'):
/* remove an item from the ScrollableList */
cp5_GUI.get(ScrollableList.class, "dropdown").removeItem("k-1");
break;
case('5'):
/* clear the ScrollableList */
cp5_GUI.get(ScrollableList.class, "dropdown").clear();
break;
}
}
/*
a list of all methods available for the ScrollableList Controller
use ControlP5.printPublicMethodsFor(ScrollableList.class);
to print the following list into the console.
You can find further details about class ScrollableList in the javadoc.
Format:
ClassName : returnType methodName(parameter type)
controlP5.Controller : CColor getColor()
controlP5.Controller : ControlBehavior getBehavior()
controlP5.Controller : ControlWindow getControlWindow()
controlP5.Controller : ControlWindow getWindow()
controlP5.Controller : ControllerProperty getProperty(String)
controlP5.Controller : ControllerProperty getProperty(String, String)
controlP5.Controller : ControllerView getView()
controlP5.Controller : Label getCaptionLabel()
controlP5.Controller : Label getValueLabel()
controlP5.Controller : List getControllerPlugList()
controlP5.Controller : Pointer getPointer()
controlP5.Controller : ScrollableList addCallback(CallbackListener)
controlP5.Controller : ScrollableList addListener(ControlListener)
controlP5.Controller : ScrollableList addListenerFor(int, CallbackListener)
controlP5.Controller : ScrollableList align(int, int, int, int)
controlP5.Controller : ScrollableList bringToFront()
controlP5.Controller : ScrollableList bringToFront(ControllerInterface)
controlP5.Controller : ScrollableList hide()
controlP5.Controller : ScrollableList linebreak()
controlP5.Controller : ScrollableList listen(boolean)
controlP5.Controller : ScrollableList lock()
controlP5.Controller : ScrollableList onChange(CallbackListener)
controlP5.Controller : ScrollableList onClick(CallbackListener)
controlP5.Controller : ScrollableList onDoublePress(CallbackListener)
controlP5.Controller : ScrollableList onDrag(CallbackListener)
controlP5.Controller : ScrollableList onDraw(ControllerView)
controlP5.Controller : ScrollableList onEndDrag(CallbackListener)
controlP5.Controller : ScrollableList onEnter(CallbackListener)
controlP5.Controller : ScrollableList onLeave(CallbackListener)
controlP5.Controller : ScrollableList onMove(CallbackListener)
controlP5.Controller : ScrollableList onPress(CallbackListener)
controlP5.Controller : ScrollableList onRelease(CallbackListener)
controlP5.Controller : ScrollableList onReleaseOutside(CallbackListener)
controlP5.Controller : ScrollableList onStartDrag(CallbackListener)
controlP5.Controller : ScrollableList onWheel(CallbackListener)
controlP5.Controller : ScrollableList plugTo(Object)
controlP5.Controller : ScrollableList plugTo(Object, String)
controlP5.Controller : ScrollableList plugTo(Object[])
controlP5.Controller : ScrollableList plugTo(Object[], String)
controlP5.Controller : ScrollableList registerProperty(String)
controlP5.Controller : ScrollableList registerProperty(String, String)
controlP5.Controller : ScrollableList registerTooltip(String)
controlP5.Controller : ScrollableList removeBehavior()
controlP5.Controller : ScrollableList removeCallback()
controlP5.Controller : ScrollableList removeCallback(CallbackListener)
controlP5.Controller : ScrollableList removeListener(ControlListener)
controlP5.Controller : ScrollableList removeListenerFor(int, CallbackListener)
controlP5.Controller : ScrollableList removeListenersFor(int)
controlP5.Controller : ScrollableList removeProperty(String)
controlP5.Controller : ScrollableList removeProperty(String, String)
controlP5.Controller : ScrollableList setArrayValue(float[])
controlP5.Controller : ScrollableList setArrayValue(int, float)
controlP5.Controller : ScrollableList setBehavior(ControlBehavior)
controlP5.Controller : ScrollableList setBroadcast(boolean)
controlP5.Controller : ScrollableList setCaptionLabel(String)
controlP5.Controller : ScrollableList setColor(CColor)
controlP5.Controller : ScrollableList setColorActive(int)
controlP5.Controller : ScrollableList setColorBackground(int)
controlP5.Controller : ScrollableList setColorCaptionLabel(int)
controlP5.Controller : ScrollableList setColorForeground(int)
controlP5.Controller : ScrollableList setColorLabel(int)
controlP5.Controller : ScrollableList setColorValue(int)
controlP5.Controller : ScrollableList setColorValueLabel(int)
controlP5.Controller : ScrollableList setDecimalPrecision(int)
controlP5.Controller : ScrollableList setDefaultValue(float)
controlP5.Controller : ScrollableList setHeight(int)
controlP5.Controller : ScrollableList setId(int)
controlP5.Controller : ScrollableList setImage(PImage)
controlP5.Controller : ScrollableList setImage(PImage, int)
controlP5.Controller : ScrollableList setImages(PImage, PImage, PImage)
controlP5.Controller : ScrollableList setImages(PImage, PImage, PImage, PImage)
controlP5.Controller : ScrollableList setLabel(String)
controlP5.Controller : ScrollableList setLabelVisible(boolean)
controlP5.Controller : ScrollableList setLock(boolean)
controlP5.Controller : ScrollableList setMax(float)
controlP5.Controller : ScrollableList setMin(float)
controlP5.Controller : ScrollableList setMouseOver(boolean)
controlP5.Controller : ScrollableList setMoveable(boolean)
controlP5.Controller : ScrollableList setPosition(float, float)
controlP5.Controller : ScrollableList setPosition(float[])
controlP5.Controller : ScrollableList setSize(PImage)
controlP5.Controller : ScrollableList setSize(int, int)
controlP5.Controller : ScrollableList setStringValue(String)
controlP5.Controller : ScrollableList setUpdate(boolean)
controlP5.Controller : ScrollableList setValue(float)
controlP5.Controller : ScrollableList setValueLabel(String)
controlP5.Controller : ScrollableList setValueSelf(float)
controlP5.Controller : ScrollableList setView(ControllerView)
controlP5.Controller : ScrollableList setVisible(boolean)
controlP5.Controller : ScrollableList setWidth(int)
controlP5.Controller : ScrollableList show()
controlP5.Controller : ScrollableList unlock()
controlP5.Controller : ScrollableList unplugFrom(Object)
controlP5.Controller : ScrollableList unplugFrom(Object[])
controlP5.Controller : ScrollableList unregisterTooltip()
controlP5.Controller : ScrollableList update()
controlP5.Controller : ScrollableList updateSize()
controlP5.Controller : String getAddress()
controlP5.Controller : String getInfo()
controlP5.Controller : String getName()
controlP5.Controller : String getStringValue()
controlP5.Controller : String toString()
controlP5.Controller : Tab getTab()
controlP5.Controller : boolean isActive()
controlP5.Controller : boolean isBroadcast()
controlP5.Controller : boolean isInside()
controlP5.Controller : boolean isLabelVisible()
controlP5.Controller : boolean isListening()
controlP5.Controller : boolean isLock()
controlP5.Controller : boolean isMouseOver()
controlP5.Controller : boolean isMousePressed()
controlP5.Controller : boolean isMoveable()
controlP5.Controller : boolean isUpdate()
controlP5.Controller : boolean isVisible()
controlP5.Controller : float getArrayValue(int)
controlP5.Controller : float getDefaultValue()
controlP5.Controller : float getMax()
controlP5.Controller : float getMin()
controlP5.Controller : float getValue()
controlP5.Controller : float[] getAbsolutePosition()
controlP5.Controller : float[] getArrayValue()
controlP5.Controller : float[] getPosition()
controlP5.Controller : int getDecimalPrecision()
controlP5.Controller : int getHeight()
controlP5.Controller : int getId()
controlP5.Controller : int getWidth()
controlP5.Controller : int listenerSize()
controlP5.Controller : void remove()
controlP5.Controller : void setView(ControllerView, int)
controlP5.ScrollableList : List getItems()
controlP5.ScrollableList : Map getItem(String)
controlP5.ScrollableList : Map getItem(int)
controlP5.ScrollableList : ScrollableList addItem(String, Object)
controlP5.ScrollableList : ScrollableList addItems(List)
controlP5.ScrollableList : ScrollableList addItems(Map)
controlP5.ScrollableList : ScrollableList addItems(String[])
controlP5.ScrollableList : ScrollableList clear()
controlP5.ScrollableList : ScrollableList close()
controlP5.ScrollableList : ScrollableList open()
controlP5.ScrollableList : ScrollableList removeItem(String)
controlP5.ScrollableList : ScrollableList removeItems(List)
controlP5.ScrollableList : ScrollableList setBackgroundColor(int)
controlP5.ScrollableList : ScrollableList setBarHeight(int)
controlP5.ScrollableList : ScrollableList setBarVisible(boolean)
controlP5.ScrollableList : ScrollableList setItemHeight(int)
controlP5.ScrollableList : ScrollableList setItems(List)
controlP5.ScrollableList : ScrollableList setItems(Map)
controlP5.ScrollableList : ScrollableList setItems(String[])
controlP5.ScrollableList : ScrollableList setOpen(boolean)
controlP5.ScrollableList : ScrollableList setScrollSensitivity(float)
controlP5.ScrollableList : ScrollableList setType(int)
controlP5.ScrollableList : boolean isBarVisible()
controlP5.ScrollableList : boolean isOpen()
controlP5.ScrollableList : int getBackgroundColor()
controlP5.ScrollableList : int getBarHeight()
controlP5.ScrollableList : int getHeight()
controlP5.ScrollableList : void controlEvent(ControlEvent)
controlP5.ScrollableList : void keyEvent(KeyEvent)
controlP5.ScrollableList : void setDirection(int)
controlP5.ScrollableList : void updateItemIndexOffset()
java.lang.Object : String toString()
java.lang.Object : boolean equals(Object)
created: 2014/09/08 01:19:14
*/
Loading

0 comments on commit 0185fea

Please sign in to comment.