Skip to content

Instantly share code, notes, and snippets.

View joselynNeon's full-sized avatar

joselynNeon joselynNeon

View GitHub Profile
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
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