/usr/share/fritzing/sketches/core/Fritzing Creator Kit DE+EN/creator-kit-de/Processing/Zaubertafel/Zaubertafel.pde is in fritzing-data 0.9.3b+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | import processing.serial.*;
import cc.arduino.*;
Arduino meinArduino;
float theta;
float theX, theY, oldX, oldY;
boolean firstRun=true;
void setup() {
size(600, 400);
println(Serial.list());
meinArduino = new Arduino(this, Arduino.list()[5], 57600);
meinArduino.pinMode(2, Arduino.INPUT);
background(224, 169, 75);
strokeWeight(3);
stroke(118, 132, 64);
}
void draw() {
theX = meinArduino.analogRead(0);
theY = meinArduino.analogRead(1);
theX = map(theX, 0, 1023, 0, width);
theY = map(theY, 0, 1023, 0, height);
if (firstRun==true) {
oldX=theX;
oldY=theY;
firstRun=false;
}
line(theX, theY, oldX, oldY);
oldX=theX;
oldY=theY;
if (meinArduino.digitalRead(2)!=0) {
background(224, 169, 75);
firstRun=true;
}
}
|