This file contains 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
/* | |
Based on ReceiveSingleValue by Oliver Steele, 2020-2022 | |
See more at https://osteele.github.io/Arduino_SerialRecord/ | |
Arduino code | |
Programmed in class - Interaction Lab 2022Fall | |
This example code is in the public domain. | |
*/ |
This file contains 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
/* This is a code example for Arduino, to be used on Recitation 7 | |
You need to have installed SerialRecord and FastLED libraries. | |
It requires NeoPixel WS2812 at pin 3 | |
Interaction Lab | |
IMA NYU Shanghai | |
2022 Fall | |
*/ | |
#include "SerialRecord.h" | |
#include <FastLED.h> |
This file contains 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
/* This is a code example for Processing, to be used on Recitation 7 | |
You need to have installed the SerialRecord library. | |
Interaction Lab | |
IMA NYU Shanghai | |
2022 Fall | |
*/ | |
import processing.serial.*; | |
import osteele.processing.SerialRecord.*; |
This file contains 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
/* | |
ReceiveSingleValue w/NeoPixel | |
This code works on Processing (after installing SerialRecord there as well: | |
ONLY FOR PROCESSING: | |
import processing.serial.*; | |
import osteele.processing.SerialRecord.*; | |
Serial serialPort; | |
SerialRecord serialRecord; |
This file contains 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 size = 100; | |
int l = 100; | |
int h = 200; | |
void setup() { | |
colorMode(HSB, 360, 100, 100); | |
size(800, 400); | |
drawPurpleTiles(); | |
} |
This file contains 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
color m; | |
int brushSize = 50; | |
void setup() { | |
colorMode(HSB, 360, 100, 100); | |
size(800, 400); | |
drawTiles(); | |
} | |
void draw() { |
This file contains 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 x = 200; | |
int speed; | |
void setup() { | |
size(400, 800); | |
float r = random(2, 5); | |
speed = int(r); | |
noStroke(); | |
} |
This file contains 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 x = 200; | |
color c; | |
void setup() { | |
size(400, 800); | |
noStroke(); | |
} | |
void draw() { | |
drawBackground(); |
This file contains 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
//Exercise coded during class 09 | |
//IMA | |
int buzzer = 8; | |
int led = 9; // the PWM pin the LED is attached to | |
int brightness = 0; // how bright the LED is | |
int fadeAmount = 5; // how many points to fade the LED by | |
int count; | |
This file contains 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
/* | |
Finite state machine with | |
Ultrasound HC-SR04 with Cherokey 4WD. | |
Programmed by Rudi - NYU Shanghai | |
Date: 28 Sept 2022 | |
This example code is in the public domain. |