mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-17 11:54:33 +01:00
Modified project14 for compatibility to Processing 3
This commit is contained in:
parent
22dd1cbb99
commit
d56e3848b4
@ -34,31 +34,33 @@ 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() {
|
||||
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/en/pub/skins/arduinoWide/img/logo.png");
|
||||
logo = loadImage("http://www.arduino.cc/arduino_logo.png");
|
||||
|
||||
// make the window the same size as the image
|
||||
size(logo.width, logo.height);
|
||||
surface.setSize(logo.width, logo.height);
|
||||
|
||||
// print a list of available serial ports to the
|
||||
// Processing staus window
|
||||
@ -76,10 +78,9 @@ void loop() {
|
||||
// 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 draw() {
|
||||
|
||||
// if there is information in the serial port
|
||||
if ( myPort.available() > 0) {
|
||||
@ -97,8 +98,5 @@ void loop() {
|
||||
|
||||
// draw the Arduino logo
|
||||
image(logo, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user