Group assignment
group project here
Individual assignment
npm install -g node-red (Windows)
sudo npm install -g node-red (Linux/Mac OS)
import processing.serial.*;
import cc.arduino.*;i
Arduino arduino;
void setup(){
size(400,400);
noStroke();
randomSeed(second());
for(int i=0; i<20; i++){
for(int j=0; j<20; j++){
fill(random(0,255), random(0,255), random(0,255));
rect(i*20, j*20, (i+1)*20, (j+1)*20);
}
}
println(Arduino. list());
arduino = new Arduino(this, "COM13", 57600);
}
void draw(){}
void mouseDragged(){
color c = get(mouseX, mouseY);
arduino.analogWrite(11, int(red(c)));
arduino.analogWrite(10, int(green(c)));
arduino.analogWrite(9, int(blue(c)));
}