Selected Courses on Digital Art-UOWM

17 Νοεμβρίου 2014

arduino14

Filed under: ARDUINO,NOTES ON INTERACTIVE ART — Ετικέτες: — admin @ 15:25
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.write(analogRead(A0)/4);

  delay(1);
}

import processing.serial.*;
Serial myPort;

PImage logo;

int bgcolor = 0;

void setup() {
  colorMode(HSB, 255);

  logo = loadImage(“http://arduino.cc/logo.png”);
  size(logo.width, logo.height);

  println(“Available serial ports:”);
  println(Serial.list());

  myPort = new Serial(this, Serial.list()[5], 9600);
}

void draw() {
  if(myPort.available() > 0) {
    bgcolor = myPort.read();
    println(bgcolor);
  }
  background(bgcolor, 255, 255);
  image(logo, 0, 0);
}

Δεν υπάρχουν Σχόλια

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress

error: Content is protected !!