This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| int val = analogRead(0); | |
| Serial.println(val); | |
| delay(10); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // [--- printertest.pde ---] | |
| // from https://forum.processing.org/one/topic/print-the-screen-image-i-mean-on-a-real-printer.html | |
| Printer myPrinter; | |
| PImage myImage; | |
| PFont myFont; | |
| void setup() | |
| { | |
| size(200,400); | |
| myPrinter = new Printer(); | |
| myImage = loadImage("arch.jpg"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| Servo myservo; | |
| int pos = 0; | |
| void setup() { | |
| Serial.begin(9600); | |
| myservo.attach(9); | |
| } | |
| void loop() { | |
| pos = analogRead(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| Servo myservo; | |
| int pos = 0; | |
| void setup() { | |
| Serial.begin(9600); | |
| myservo.attach(9); | |
| } | |
| void loop() { | |
| pos = analogRead(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| pinMode(13, OUTPUT); | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| Serial.println(analogRead(0)); | |
| if ( analogRead(0) < 200) { | |
| digitalWrite(13, HIGH); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| pinMode(13, OUTPUT); | |
| Serial.begin(9600); | |
| pinMode(2, INPUT_PULLUP); | |
| } | |
| void loop() { | |
| Serial.println(digitalRead(2)); | |
| if (digitalRead(2) == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(300, 300); | |
| background(255, 0, 0); | |
| } | |
| void draw() { | |
| delay(100); | |
| background(random(255), random(255), random(255)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| Serial.begin(9600); | |
| Serial.println("begin"); | |
| pinMode(2, INPUT); | |
| pinMode(3, OUTPUT); | |
| pinMode(13, OUTPUT); | |
| digitalWrite(3, HIGH); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int myNum = 0; | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(13,OUTPUT); | |
| } | |
| void loop() { | |
| if(Serial.available()>0){ | |
| int val = Serial.read(); | |
| if(val == 65){ myNum = 1;} | |
| if(val == 66){ myNum = 0;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import processing.serial.*; | |
| Serial myPort; | |
| int val; | |
| int myColor = 0; | |
| void setup() | |
| { | |
| size(200, 200); | |
| myPort = new Serial(this, Serial.list()[2], 9600); // 0 , 1 ,2 | |
| } | |
| void draw() |