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
// Libraries | |
import processing.serial.*; | |
import cc.arduino.*; | |
//Calling Arduino Ports | |
//Numbers represent pins | |
Arduino arduino; |
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
//use arrow keys to increase or decrease the speed of the object | |
//dependng on where the your mosue is on the canvas you will get a different shade of colors | |
// these are for the positioning of the squares | |
float x = 100; | |
float y = 100; | |
float xSpeed = 2; | |
float ySpeed = 3; | |
// mapping so that my colors and mouse positioning are nice and free to roam | |
float Color = map(mouseX, 0, 900, 0, 500); | |
float Color2 = map(mouseY, 0, 900, 0, 500); |
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
const int LED = 9; // the pin for the LED | |
const int BUTTON = 7; // input pin of the pushbutton | |
int val = 0; // stores the state of the input pin | |
int old_val = 0; // stores the previous value of "val" | |
int state = 0; // 0 = LED off while 1 = LED on | |
int brightness = 128; // Stores the brightness value | |
unsigned long startTime = 0; // when did we begin pressing? | |
void setup() { | |
pinMode(LED, OUTPUT); // tell Arduino LED is an output | |
pinMode(BUTTON, INPUT); // and BUTTON is an input |
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
float myLat = 0; | |
int led1 = 11; | |
int led2 = 10; | |
void setup() | |
{ | |
// Open serial port between app and LilyPad: | |
Serial.begin(9600); | |
// setting up the pinModes | |
pinMode(led1, OUTPUT); |