Skip to content

Modified project14 for compatibility to Processing 3 #4015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,71 +34,69 @@ void loop() {
}

/* Processing code for this example
// Tweak the Arduno Logo
// by Scott Fitzgerald
// This example code is in the public domain
// Tweak the Arduno Logo
// by Scott Fitzgerald
// This example code is in the public domain

// import the serial library
import processing.serial.*;
// import the serial library
import processing.serial.*;

// create an instance of the serial library
Serial myPort;
// create an instance of the serial library
Serial myPort;

// create an instance of PImage
PImage logo;
// create an instance of PImage
PImage logo;

// a variable to hold the background color
int bgcolor = 0;
// a variable to hold the background color
int bgcolor = 0;

void setup() {
// set the color mode to Hue/Saturation/Brightness
colorMode(HSB, 255);

// load the Arduino logo into the PImage instance
logo = loadImage("http://www.arduino.cc/en/pub/skins/arduinoWide/img/logo.png");

// make the window the same size as the image
size(logo.width, logo.height);

// print a list of available serial ports to the
// Processing staus window
println("Available serial ports:");
println(Serial.list());

// Tell the serial object the information it needs to communicate
// with the Arduno. Change Serial.list()[0] to the correct
// port corresponding to your Arduino board. The last
// parameter (e.g. 9600) is the speed of the communication. It
// has to correspond to the value passed to Serial.begin() in your
// Arduino sketch.
myPort = new Serial(this, Serial.list()[0], 9600);

// If you know the name of the port used by the Arduino board, you
// can specify it directly like this.
// port = new Serial(this, "COM1", 9600);

}

void draw() {
void setup() {
size(1, 1);
surface.setResizable(true);
// set the color mode to Hue/Saturation/Brightness
colorMode(HSB, 255);

// load the Arduino logo into the PImage instance
logo = loadImage("http://www.arduino.cc/arduino_logo.png");

// make the window the same size as the image
surface.setSize(logo.width, logo.height);

// print a list of available serial ports to the
// Processing staus window
println("Available serial ports:");
println(Serial.list());

// Tell the serial object the information it needs to communicate
// with the Arduno. Change Serial.list()[0] to the correct
// port corresponding to your Arduino board. The last
// parameter (e.g. 9600) is the speed of the communication. It
// has to correspond to the value passed to Serial.begin() in your
// Arduino sketch.
myPort = new Serial(this, Serial.list()[0], 9600);

// If you know the name of the port used by the Arduino board, you
// can specify it directly like this.
// port = new Serial(this, "COM1", 9600);
}

// if there is information in the serial port
if ( myPort.available() > 0) {
// read the value and store it in a variable
bgcolor = myPort.read();
void draw() {

// print the value to the status window
println(bgcolor);
}
// if there is information in the serial port
if ( myPort.available() > 0) {
// read the value and store it in a variable
bgcolor = myPort.read();

// Draw the background. the variable bgcolor
// contains the Hue, determined by the value
// from the serial port
background(bgcolor, 255, 255);
// print the value to the status window
println(bgcolor);
}

// draw the Arduino logo
image(logo, 0, 0);
}
// Draw the background. the variable bgcolor
// contains the Hue, determined by the value
// from the serial port
background(bgcolor, 255, 255);

// draw the Arduino logo
image(logo, 0, 0);
}
*/