diff --git a/art/RGB-LED-Potentiometer.fzz b/art/RGB-LED-Potentiometer.fzz new file mode 100644 index 0000000..87b52b3 Binary files /dev/null and b/art/RGB-LED-Potentiometer.fzz differ diff --git a/art/RGB-LED.fzz b/art/RGB-LED.fzz new file mode 100644 index 0000000..250d4d1 Binary files /dev/null and b/art/RGB-LED.fzz differ diff --git a/art/buzzer-pcb.svg b/art/buzzer-pcb.svg new file mode 100644 index 0000000..727016d --- /dev/null +++ b/art/buzzer-pcb.svg @@ -0,0 +1,94 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/art/rgb-led.svg b/art/rgb-led.svg new file mode 100644 index 0000000..418e2a2 --- /dev/null +++ b/art/rgb-led.svg @@ -0,0 +1,268 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + 1337 + + + + + 1337 + + + + + 1337 + + + + + + + R + G + + B + - + + + + + + diff --git a/presentations/workshop-may-2016/images/arduino-board.png b/presentations/workshop-may-2016/images/arduino-board.png index 9a8e7d9..cb295fd 100644 Binary files a/presentations/workshop-may-2016/images/arduino-board.png and b/presentations/workshop-may-2016/images/arduino-board.png differ diff --git a/presentations/workshop-may-2016/images/scanlime-eclipse-home.jpg b/presentations/workshop-may-2016/images/scanlime-eclipse-home.jpg new file mode 100644 index 0000000..b7e9941 Binary files /dev/null and b/presentations/workshop-may-2016/images/scanlime-eclipse-home.jpg differ diff --git a/presentations/workshop-may-2016/images/scanlime-eclipse-install.jpg b/presentations/workshop-may-2016/images/scanlime-eclipse-install.jpg new file mode 100644 index 0000000..ac12ea8 Binary files /dev/null and b/presentations/workshop-may-2016/images/scanlime-eclipse-install.jpg differ diff --git a/presentations/workshop-may-2016/images/scanlime-forest.jpg b/presentations/workshop-may-2016/images/scanlime-forest.jpg new file mode 100644 index 0000000..5f715e6 Binary files /dev/null and b/presentations/workshop-may-2016/images/scanlime-forest.jpg differ diff --git a/presentations/workshop-may-2016/images/scanlime-zen-photon-garden.png b/presentations/workshop-may-2016/images/scanlime-zen-photon-garden.png new file mode 100644 index 0000000..923ece0 Binary files /dev/null and b/presentations/workshop-may-2016/images/scanlime-zen-photon-garden.png differ diff --git a/presentations/workshop-may-2016/talk.ebook.pdf b/presentations/workshop-may-2016/talk.ebook.pdf index b2ee77c..d56ff2c 100644 Binary files a/presentations/workshop-may-2016/talk.ebook.pdf and b/presentations/workshop-may-2016/talk.ebook.pdf differ diff --git a/presentations/workshop-may-2016/talk.md b/presentations/workshop-may-2016/talk.md index 667afaf..6cf5f4a 100644 --- a/presentations/workshop-may-2016/talk.md +++ b/presentations/workshop-may-2016/talk.md @@ -1,11 +1,47 @@ --- author: Fred Cahill, Shawn Nock institute: Unlondon Digital Media Assoc. -title: Arduino for the Arts +title: Introduction to Art Engineering +subtitle: Medway High School lang: en-CA colorlinks: true ... +# Goals + +## Art Engineering + +- Science, technology, engineering and maths; in service of Art. +- Allows unprecedented interaction +- Opens doors to new funding sources, non-traditional gallery space. + +## Unlondon + +## Shawn: Biohacking + +## @scanlime: Micah Elizabeth Scott, Art Engineer + +> "...she explores the boundaries between technology, society, and creative +> expression, using her unique perspective to try and help illuminate +> what makes us human." +[^1] + +- Eclipse +- Forest +- Zen Photon Garden + +[^1]: Micah's Portfolio Website: [misc.name](http://www.misc.name) + +## @kimalpert: Kim Alpert, Aesthetic Engineer + +> "With a background in fine art, world music, and carpentry, Kim Alpert +> " brings an attention to detail and diverse style to her work." +[^2] + +- Bodyphonic @ National Music Center, Calgary + +[^2]: Kim's Portfolio Website: [http://aestheticengineer.com](http://aestheticengineer.com) + # What's in your kit? ## Kit Contents @@ -47,6 +83,25 @@ for their boards and then write the programs to the $\mu$C. # Circuit Basics +## Current + +Current is the flow of charge through a circuit. Conventionally we +think of this as happening from $+$ to $-$ of the power supply of the +circuit. + +## Voltage / Potential / Resistance + +Voltage is how fast the current can move in the circuit. River +metaphor: + + - current = flow rate: ($\si{\liter\per\second}$) + - voltage = change in height: ($\si{\meter}$) + +Other devices in a circuit can impede / effect current flow. We'll +call them resistance(s). + +# Circuit Devices + ## Diode \begin{columns}[c] @@ -95,31 +150,31 @@ for their boards and then write the programs to the $\mu$C. \end{columns} -## Ohm's Law + -Ohm's Law relates current to potential and resistance. + -$$ V = IR $$ -$$ I=\frac{V}{R} $$ -$$ R = \frac{V}{I} $$ + + + -* V = Potential in Volts (\si{\volt}) -* I = Current in Amperes (\si{\ampere}) -* R = Resistance in Ohms (\si{\ohm}) + + + -## Ohm's Law: Example + -The datasheet for an LED says that the maximum continuous current is -\SI{15}{\milli\ampere}. Your circuit operates at \SI{5}{\volt}\footnotemark[1]. How -big should your resistor be? + + + -$$ \si{\ohm} = \frac{\SI{5}{\volt}}{\SI{0.015}{\ampere}} = 333.\overline{3}\si{\ohm} $$ + -How much current for our *cheet sheet* value? + -$$ \si{\ampere} = \frac{\SI{5}{\volt}}{\SI{400}{\ohm}} = \SI{12.5}{\milli\ampere} $$ + -\footnotetext[1]{\tiny Actually, this calculation is inaccurate. LEDs will have a *forward voltage drop* of between \SI{300}{\milli\volt} and \SI{700}{\milli\volt} this should be subtracted from \si{\volt} above... but it's not critical.} + ## Buttons @@ -154,7 +209,6 @@ Piezoelectric|Electrical $\rightarrow$ Motion - Two connections: Vcc, GND - Use a switch; connected = annoying tone, disconnected = glorious silence - ## Power The power supply provides the energy to drive the system *and* defines logical 1. @@ -162,12 +216,12 @@ The power supply provides the energy to drive the system *and* defines logical 1 Can be a: * Voltage Regulator (converts one potential to another) -* Batteries (Lemon, NiMH, LiPo) +* Batteries * Solar Panel -In our circuits, your laptop is converting it's power source to 5V and +In our circuits, your laptop is converting it's power source to $\SI{5}{\volt}$ and delivering power to our circuit via USB. You also have a battery pack -for computer-free shenanigans. +for computer-free shenanigans ($\SI{6}{\volt}$). ## $\mu$Controller @@ -185,10 +239,18 @@ Peripherals : Vary chip to chip, but often include timers, radios, communication interfaces Seems complicated, but really simple. They literally read a command -(and data) from memory, then execute the command. At the end of the -command, the next command is read from the next memory cell and the -process is -repeated^[some commands change the next command memory address] +from memory, then execute the command. At the end of the +command, read the next command from the next memory cell and +repeat^[some commands change the next command memory address] + +## $\mu$C + Digital Signals as Switches + +If one end of an LED is connected to ground, and the other end is +connected to a pin on a $\mu$Controller, then: + +If the $\mu$C sets the pin HIGH ($\SI{5}{\volt}$) then current will +flow from the pin through the LED to GND, if LOW ($\SI{0}{\volt}) then +the current will not flow and the LED is off. # Let's start programming @@ -226,62 +288,62 @@ void loop() { } ~~~ -## Buzzer: Hardware + -\begin{center} -\includegraphics[width=0.98\textwidth]{images/buzzer-breadboard.png} -\end{center} + + + -## Buzzer: Software + -~~~ C -#define BUZZER 8 /* Make BUZZER same as pin 8 */ + + -void setup() { - pinMode(BUZZER, OUTPUT); - digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ -} -void loop() { - digitalWrite(BUZZER, LOW); /* Turn on buzzer */ - delay(100); /* wait for 100ms */ - digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ - delay(900); /* wait 900ms */ -} -~~~ + + + + + + + + + + + -## Push Button: Hardware + -\begin{center} -\includegraphics[width=0.98\textwidth]{images/buzzer-button-breadboard.png} -\end{center} + + + -## Push Button: Software (Part 1) + -~~~ C -#define BUTTON 7 -#define BUZZER 8 + + + -int button_state = 0; + -void setup() { - pinMode(BUTTON, INPUT); - pinMode(BUZZER, OUTPUT); - digitalWrite(BUZZER, HIGH); -} -~~~ + + + + + + -## Push Button: Software (Part 2) + -~~~ C -void loop() { - button_state = digitalRead(BUTTON); - if (button_state == HIGH) { - digitalWrite(BUZZER, LOW); - } else { - digitalWrite(BUZZER, HIGH); - } -} -~~~ + + + + + + + + + + ## The End? diff --git a/presentations/workshop-may-2016/talk.pdf b/presentations/workshop-may-2016/talk.pdf index ebbd70d..6406da0 100644 Binary files a/presentations/workshop-may-2016/talk.pdf and b/presentations/workshop-may-2016/talk.pdf differ diff --git a/presentations/workshop-may-2016/template.tex b/presentations/workshop-may-2016/template.tex index 74094e1..3953a2c 100644 --- a/presentations/workshop-may-2016/template.tex +++ b/presentations/workshop-may-2016/template.tex @@ -12,6 +12,7 @@ $endif$ \usepackage{ifxetex,ifluatex} \usepackage{wrapfig} \usepackage{siunitx} +\usepackage{pdfpc-commands} \usepackage{fixltx2e} % provides \textsubscript \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} diff --git a/sketchbook/Blink-RGB/Blink-RGB.ino b/sketchbook/Blink-RGB/Blink-RGB.ino index 89163f9..a2b2644 100644 --- a/sketchbook/Blink-RGB/Blink-RGB.ino +++ b/sketchbook/Blink-RGB/Blink-RGB.ino @@ -8,9 +8,9 @@ by Shawn Nock */ -#define RED 2 -#define GREEN 3 -#define BLUE 4 +#define RED 6 +#define GREEN 5 +#define BLUE 3 int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000) diff --git a/sketchbook/RGB-Fade/RGB-Fade.ino b/sketchbook/RGB-Fade/RGB-Fade.ino new file mode 100644 index 0000000..ece78bd --- /dev/null +++ b/sketchbook/RGB-Fade/RGB-Fade.ino @@ -0,0 +1,47 @@ +/* + RGB Fade-in, Fade-out + + Alternates R, G and B LED on for one second, then off for one second, repeatedly. + Fading in and out + + This example code is in the public domain. + + modified 20 May 2016 + by Shawn Nock + */ + +#define RED 6 +#define GREEN 5 +#define BLUE 3 + +#define STEPS 8 +#define MAX_BRIGHTNESS 255 +#define BRIGHTNESS_INCREMENT (MAX_BRIGHTNESS / STEPS) +#define DELAY 1000 +#define DELAY_INCREMENT (DELAY / STEPS) + +int leds[3] = {RED, GREEN, BLUE}; + +void setup() { + pinMode(RED, OUTPUT); + pinMode(GREEN, OUTPUT); + pinMode(BLUE, OUTPUT); +} + +void loop() { + for (int i = 0; i < 3; i++) { + int cur_led = leds[i]; + for (int x = 1; x <= STEPS; x++) { + int cur_brightness = BRIGHTNESS_INCREMENT * x; + analogWrite(cur_led, cur_brightness); + delay(DELAY_INCREMENT * x); + } + for (int x = STEPS; x < 0; x--) { + int cur_brightness = BRIGHTNESS_INCREMENT * x; + analogWrite(cur_led, cur_brightness); + delay(DELAY_INCREMENT * x); + } + } + delay(DELAY); +} + diff --git a/sketchbook/RGB-Remote-Buzzer/RGB-Remote-Buzzer.ino b/sketchbook/RGB-Remote-Buzzer/RGB-Remote-Buzzer.ino index ac2c5e3..c37d598 100644 --- a/sketchbook/RGB-Remote-Buzzer/RGB-Remote-Buzzer.ino +++ b/sketchbook/RGB-Remote-Buzzer/RGB-Remote-Buzzer.ino @@ -11,9 +11,9 @@ #include #include "medway-remote.h" // Button definitions for medway kit remote -#define RED 3 -#define GREEN 4 -#define BLUE 5 +#define RED 6 +#define GREEN 5 +#define BLUE 3 #define IR_PIN 2 #define BUZZER 10 diff --git a/sketchbook/Variable-Blink-RGB-Switch/Variable-Blink-RGB-Switch.ino b/sketchbook/Variable-Blink-RGB-Switch/Variable-Blink-RGB-Switch.ino index 9c25560..caf97d1 100644 --- a/sketchbook/Variable-Blink-RGB-Switch/Variable-Blink-RGB-Switch.ino +++ b/sketchbook/Variable-Blink-RGB-Switch/Variable-Blink-RGB-Switch.ino @@ -1,4 +1,4 @@ -/* + /* RGB Blink Alternates R, G and B LED; vary the frequncy by the position of the potentiometer diff --git a/sketchbook/Variable-Blink-RGB/Variable-Blink-RGB.ino b/sketchbook/Variable-Blink-RGB/Variable-Blink-RGB.ino index 4eb4e3d..c44d328 100644 --- a/sketchbook/Variable-Blink-RGB/Variable-Blink-RGB.ino +++ b/sketchbook/Variable-Blink-RGB/Variable-Blink-RGB.ino @@ -9,9 +9,9 @@ by Shawn Nock */ -#define RED 3 -#define GREEN 4 -#define BLUE 5 +#define RED 6 +#define GREEN 5 +#define BLUE 3 int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000) diff --git a/sketchbook/Variable-Brightness-RGB/Variable-Brightness-RGB.ino b/sketchbook/Variable-Brightness-RGB/Variable-Brightness-RGB.ino new file mode 100644 index 0000000..d9f9d3b --- /dev/null +++ b/sketchbook/Variable-Brightness-RGB/Variable-Brightness-RGB.ino @@ -0,0 +1,37 @@ +/* + RGB Dimmer + Alternates R, G and B LED on for one second, then off for one second, repeatedly. + The brightness depends on the position of the attached potentiometer + + This example code is in the public domain. + + modified 20 May 2016 + by Shawn Nock + */ + +#define RED 6 +#define GREEN 5 +#define BLUE 3 + +int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000) +int brightness = 0; + +// the setup function runs once when you press reset or power the board +void setup() { + // initialize digital pin 13 as an output. + pinMode(RED, OUTPUT); + pinMode(GREEN, OUTPUT); + pinMode(BLUE, OUTPUT); +} + +void loop() { + brightness = analogRead(A0) >> 2; + analogWrite(RED, brightness); + delay(delay_ms); + digitalWrite(RED, LOW); + delay(delay_ms); + analogWrite(GREEN, brightness); + delay(delay_ms); + digitalWrite(BLUE, LOW); + delay(delay_ms); +}