Skip to content

Instantly share code, notes, and snippets.

View tboydar's full-sized avatar
🎯
Focusing

Dar tboydar

🎯
Focusing
View GitHub Profile
void setup() {
Serial.begin(9600);
}
void loop() {
int val = analogRead(0);
Serial.println(val);
delay(10);
}
@tboydar
tboydar / printertest.pde
Created April 11, 2018 09:29
processing printer
// [--- 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");
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
pos = analogRead(0);
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
pos = analogRead(0);
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(0));
if ( analogRead(0) < 200) {
digitalWrite(13, HIGH);
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
}
void loop() {
Serial.println(digitalRead(2));
if (digitalRead(2) == 0) {
void setup() {
size(300, 300);
background(255, 0, 0);
}
void draw() {
delay(100);
background(random(255), random(255), random(255));
}
void setup() {
Serial.begin(9600);
Serial.println("begin");
pinMode(2, INPUT);
pinMode(3, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(3, HIGH);
}
@tboydar
tboydar / gist:6efc05b6e16dcf0acc8e829098a16461
Created November 30, 2017 07:22
arduino / processing arduino
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;}
@tboydar
tboydar / gist:97a360214d8321c75391d16c307f1e02
Created November 30, 2017 07:22
processing / processing arduino
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()