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 spacebrew.*; | |
import processing.serial.*; | |
// define the spacebrew server location, app name and description | |
String server = "sandbox.spacebrew.cc"; | |
String name = "give me a SHORT NAME PLEASE!"; | |
String description = "This is an example client which publishes the value of a analog sensor from an Arduino "; | |
Spacebrew sb; // Spacebrew connection object | |
Serial myPort; // Serial port object |
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
/** | |
* Rainbow. | |
* Click the mouse anywhere on the sketch to activate the rainbow animation. | |
* | |
*/ | |
////////////////////////////// | |
import spacebrew.*; | |
Spacebrew spacebrewConnection; |
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
/** | |
* Rainbow. | |
* Click the mouse anywhere on the sketch to activate the rainbow animation. | |
* | |
*/ | |
int barWidth = 20; | |
int barCurrent = 0; | |
int barTotal = 0; | |
boolean drawingRainbow = false; |
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
/** | |
* Spacebrew Bass the Ball | |
* | |
* Sketch where a ball goes across the screen and get's passed to | |
* another sketch. Sketches are connected using Spacebrew. | |
* | |
* Developed for Spacebrew workshop at ITP Camp 2013. | |
* | |
* Sketch based on Bouncing Ball Sketch developed by Dan Shiffman | |
* for Nature of Code. |
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 spacebrew.*; | |
import processing.serial.*; | |
Serial port; | |
Spacebrew spacebrewConnection; | |
String server="sandbox.spacebrew.cc"; | |
String name="ArduinoLEDRangeOutput"; | |
String description = "Physical LED bar. Send me a number and I'll graph it."; |
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
#include "LPD8806.h" | |
#include "SPI.h" | |
// Number of RGB LEDs in strand: | |
int nLEDs = 32; | |
// Chose 2 pins for output; can be any valid output pins: | |
int dataPin = 4; | |
int clockPin = 5; |
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 spacebrew.*; | |
import processing.serial.*; | |
String server = "sandbox.spacebrew.cc"; | |
String name = "PhotoCell_Publisher_" + floor(random(1000)); | |
String description = "This is an example client which publishes the value of a photocell connected to an Arduino "; | |
int bright = 0; // the value of the phtocell we weill send over spacebrew | |
Spacebrew spacebrewConnection; // Spacebrew connection object |
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
void setup() { | |
// open serial port | |
Serial.begin(9600); | |
} | |
void loop() { | |
// read and send the value of analog sensor | |
long raw_val = analogRead(A0); | |
// use to adjust the range, if necessary |
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 spacebrew.*; | |
String server="sandbox.spacebrew.cc"; | |
String name="Meet Clawdia"; | |
String description ="This is a client that connects to "; | |
import processing.serial.*; | |
Serial myPort; // Create object from Serial class | |
boolean serial_connected = false; |
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
#include <Servo.h> | |
// CONSTANTS - keys for parsing messages via serial | |
#define GRAB 'G' | |
#define SWING 'S' | |
#define ROTATE 'R' | |
#define ANALOG_GRAB 'A' | |
// CONSTANTS - message length, servo count, and debug | |
#define MSG_LEN 16 |
NewerOlder