plotclock

100 mechinacal movement

uno talke

pinMode(2, INPUT_PULLUP);

p5 - arduino

Serial 3 - DIY Protocol

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available()>0){
    char input = Serial.read();
    if(input == 'H'){
      digitalWrite(11, HIGH);
    }
    if(input == 'L'){
      digitalWrite(11, LOW);
    }
  }
}

serial to processing

import processing.serial.*;

Serial myPort;
int xPos;

void setup(){
  size(255,255);
  //println(Serial.list());
  String portName = "/dev/tty.usbmodemfa13231";
  myPort = new Serial(this, portName, 9600);
}

void draw(){
  background(0);
  fill(255);
  ellipse(xPos, height/2, 20, 20);
}

void serialEvent(Serial myPort){
  xPos = myPort.read();
}