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 pygame, sys | |
from time import sleep | |
# setup the pygame window | |
pygame.init() | |
window = pygame.display.set_mode((200, 200), 0, 32) | |
# how many joysticks connected to computer? | |
joystick_count = pygame.joystick.get_count() | |
print "There is " + str(joystick_count) + " joystick/s" |
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 processing.io.*; | |
boolean ledStatus = false; | |
int rectX = 50; | |
int rectY = 50; | |
int rectW = 200; | |
int fillCol; | |
void setup() { | |
size(300,300); |
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 processing.serial.*; | |
Serial port; | |
String portID = "/dev/ttyAMA0"; | |
void setup() { | |
size(100,100); | |
background(255) | |
port = new Serial(this,portID,9600); | |
} |
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 processing.serial.*; | |
Serial port; | |
String portID = "/dev/ttyAMA0"; | |
int squareSize = 80; | |
int[] colColours = {#061A07,#072409,#0F4812,#136A18,#198B20,#1DA724,#20C629,#36FF41}; | |
int[] colLengths = {9,8,7,6,5,4,3,2}; | |
int selectedCol = 3; |
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 ddf.minim.*; | |
import ddf.minim.analysis.*; | |
import ddf.minim.effects.*; | |
import ddf.minim.signals.*; | |
import ddf.minim.spi.*; | |
import ddf.minim.ugens.*; | |
import processing.serial.*; | |
Serial port; | |
String portID = "/dev/ttyAMA0"; |
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
#!/usr/bin/python | |
import spidev | |
import time | |
# which ADC input the sensor is connected to | |
sensor = 0 | |
# the boundary between no line detected and a line detected | |
boundary = 30 |