1
0
Fork 0

Adds inspirational art-engineer people, some art / fritzing setups for the projects

This commit is contained in:
Shawn Nock 2016-05-22 11:27:27 -04:00
parent 44fbfa9379
commit c010986462
19 changed files with 588 additions and 79 deletions

Binary file not shown.

BIN
art/RGB-LED.fzz Normal file

Binary file not shown.

94
art/buzzer-pcb.svg Normal file
View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="2cm"
height="2cm"
viewBox="0 0 70.866142 70.86614"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="buzzer-pcb.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="256"
inkscape:cx="19.9988"
inkscape:cy="16.522145"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="cm"
inkscape:window-width="1364"
inkscape:window-height="749"
inkscape:window-x="0"
inkscape:window-y="17"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-981.49612)">
<ellipse
style="opacity:1;fill:#333333;fill-opacity:1;stroke:#000000;stroke-width:20.27537918;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4136"
cx="35.885506"
cy="1014.0767"
rx="18.50668"
ry="17.864086" />
<ellipse
style="opacity:1;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4165"
cx="54.06871"
cy="993.79309"
rx="1.077571"
ry="1.0141845" />
<ellipse
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4165-2"
cx="19.776598"
cy="1035.8818"
rx="1.077571"
ry="1.0141845" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 54.051655,992.96434 0,1.64809"
id="path4182"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 53.305774,993.79498 1.521239,0"
id="path4182-4"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 19.016724,1035.9052 1.521239,0"
id="path4182-4-0"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

268
art/rgb-led.svg Normal file
View File

@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1.5cm"
height="2cm"
viewBox="0 0 53.149606 70.86614"
id="svg4232"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="rgb-led.svg">
<defs
id="defs4234" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.8881111"
inkscape:cx="26.574803"
inkscape:cy="35.433071"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="cm"
inkscape:window-width="1364"
inkscape:window-height="749"
inkscape:window-x="0"
inkscape:window-y="17"
inkscape:window-maximized="0" />
<metadata
id="metadata4237">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-981.49612)">
<rect
style="opacity:1;fill:#008000;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4780"
width="45.384758"
height="56.794327"
x="3.5496457"
y="984.2851" />
<circle
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4784"
cx="25.608158"
cy="999.62476"
r="7.7331567" />
<g
id="g4794"
transform="matrix(0,1,-1,0,1074.4207,1022.9508)">
<rect
y="1043.3613"
x="-12.296987"
height="2.5354612"
width="5.5780149"
id="rect4786"
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
y="1043.3783"
x="-11.637768"
height="2.4932036"
width="4.2004142"
id="rect4788"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<text
sodipodi:linespacing="125%"
id="text4790"
y="1045.0103"
x="-11.117084"
style="font-style:normal;font-weight:normal;font-size:1.25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="1045.0103"
x="-11.117084"
id="tspan4792"
sodipodi:role="line">1337</tspan></text>
</g>
<g
transform="translate(31.179736,-22.658339)"
id="g4794-7">
<rect
y="1043.3613"
x="-12.296987"
height="2.5354612"
width="5.5780149"
id="rect4786-7"
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
y="1043.3783"
x="-11.637768"
height="2.4932036"
width="4.2004142"
id="rect4788-4"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<text
sodipodi:linespacing="125%"
id="text4790-6"
y="1045.0103"
x="-11.117084"
style="font-style:normal;font-weight:normal;font-size:1.25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="1045.0103"
x="-11.117084"
id="tspan4792-7"
sodipodi:role="line">1337</tspan></text>
</g>
<g
transform="translate(26.690643,-30.754563)"
id="g4794-3">
<rect
y="1043.3613"
x="-12.296987"
height="2.5354612"
width="5.5780149"
id="rect4786-4"
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
y="1043.3783"
x="-11.637768"
height="2.4932036"
width="4.2004142"
id="rect4788-2"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<text
sodipodi:linespacing="125%"
id="text4790-3"
y="1045.0103"
x="-11.117084"
style="font-style:normal;font-weight:normal;font-size:1.25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="1045.0103"
x="-11.117084"
id="tspan4792-0"
sodipodi:role="line">1337</tspan></text>
</g>
<rect
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#f0dc5c;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4843"
width="45.13121"
height="9.1276608"
x="3.7721236"
y="1031.9015" />
<path
style="fill:#9a916c;fill-rule:evenodd;stroke:#f0dc5c;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:0"
d="m 13.280612,1035.6353 -0.125367,13.1966"
id="path4841"
inkscape:connector-curvature="0" />
<path
style="fill:#9a916c;fill-rule:evenodd;stroke:#f0dc5c;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:0"
d="m 39.010687,1035.6353 -0.125366,13.1966"
id="path4841-1"
inkscape:connector-curvature="0" />
<path
style="fill:#9a916c;fill-rule:evenodd;stroke:#f0dc5c;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:0"
d="m 30.433995,1035.6353 -0.125367,13.1966"
id="path4841-7"
inkscape:connector-curvature="0" />
<path
style="fill:#9a916c;fill-rule:evenodd;stroke:#f0dc5c;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:0"
d="m 21.857301,1035.6353 -0.125367,13.1966"
id="path4841-4"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:6.42520189px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="10.571275"
y="1059.9026"
id="text4872"
sodipodi:linespacing="125%"
transform="scale(1.0280323,0.97273208)"><tspan
sodipodi:role="line"
id="tspan4874"
x="10.571275"
y="1059.9026">R</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:6.42520189px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="19.408518"
y="1059.8994"
id="text4872-9"
sodipodi:linespacing="125%"
transform="scale(1.0280323,0.97273208)"><tspan
sodipodi:role="line"
id="tspan4874-1"
x="19.408518"
y="1059.8994">G</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:22.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="29.284576"
y="1028.4021"
id="text4894"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4896"
x="29.284576"
y="1028.4021"></tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:6.42520189px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="28.148508"
y="1059.9026"
id="text4872-9-3"
sodipodi:linespacing="125%"
transform="scale(1.0280323,0.97273208)"><tspan
sodipodi:role="line"
id="tspan4874-1-4"
x="28.148508"
y="1059.9026">B</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:6.42520189px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="36.706528"
y="1059.3206"
id="text4872-9-8"
sodipodi:linespacing="125%"
transform="scale(1.0280323,0.97273208)"><tspan
sodipodi:role="line"
id="tspan4874-1-5"
x="36.706528"
y="1059.3206">-</tspan></text>
<circle
style="opacity:1;fill:#9a916c;fill-opacity:0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4945"
cx="13.154036"
cy="1048.837"
r="0.99163353" />
<circle
style="opacity:1;fill:#9a916c;fill-opacity:0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4945-9"
cx="21.735374"
cy="1048.8407"
r="0.99163353" />
<circle
style="opacity:1;fill:#9a916c;fill-opacity:0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4945-6"
cx="30.308708"
cy="1048.8428"
r="0.99163353" />
<circle
style="opacity:1;fill:#9a916c;fill-opacity:0;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4945-0"
cx="38.886665"
cy="1048.8372"
r="0.99163353" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View File

@ -1,11 +1,47 @@
--- ---
author: Fred Cahill, Shawn Nock author: Fred Cahill, Shawn Nock
institute: Unlondon Digital Media Assoc. institute: Unlondon Digital Media Assoc.
title: Arduino for the Arts title: Introduction to Art Engineering
subtitle: Medway High School
lang: en-CA lang: en-CA
colorlinks: true 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? # What's in your kit?
## Kit Contents ## Kit Contents
@ -47,6 +83,25 @@ for their boards and then write the programs to the $\mu$C.
# Circuit Basics # 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 ## Diode
\begin{columns}[c] \begin{columns}[c]
@ -95,31 +150,31 @@ for their boards and then write the programs to the $\mu$C.
\end{columns} \end{columns}
## Ohm's Law <!-- ## Ohm's Law -->
Ohm's Law relates current to potential and resistance. <!-- Ohm's Law relates current to potential and resistance. -->
$$ V = IR $$ <!-- $$ V = IR $$ -->
$$ I=\frac{V}{R} $$ <!-- $$ I=\frac{V}{R} $$ -->
$$ R = \frac{V}{I} $$ <!-- $$ R = \frac{V}{I} $$ -->
* V = Potential in Volts (\si{\volt}) <!-- * V = Potential in Volts (\si{\volt}) -->
* I = Current in Amperes (\si{\ampere}) <!-- * I = Current in Amperes (\si{\ampere}) -->
* R = Resistance in Ohms (\si{\ohm}) <!-- * R = Resistance in Ohms (\si{\ohm}) -->
## Ohm's Law: Example <!-- ## Ohm's Law: Example -->
The datasheet for an LED says that the maximum continuous current is <!-- 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 <!-- \SI{15}{\milli\ampere}. Your circuit operates at \SI{5}{\volt}\footnotemark[1]. How -->
big should your resistor be? <!-- big should your resistor be? -->
$$ \si{\ohm} = \frac{\SI{5}{\volt}}{\SI{0.015}{\ampere}} = 333.\overline{3}\si{\ohm} $$ <!-- $$ \si{\ohm} = \frac{\SI{5}{\volt}}{\SI{0.015}{\ampere}} = 333.\overline{3}\si{\ohm} $$ -->
How much current for our *cheet sheet* value? <!-- How much current for our *cheet sheet* value? -->
$$ \si{\ampere} = \frac{\SI{5}{\volt}}{\SI{400}{\ohm}} = \SI{12.5}{\milli\ampere} $$ <!-- $$ \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.} <!-- \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 ## Buttons
@ -154,7 +209,6 @@ Piezoelectric|Electrical $\rightarrow$ Motion
- Two connections: Vcc, GND - Two connections: Vcc, GND
- Use a switch; connected = annoying tone, disconnected = glorious silence - Use a switch; connected = annoying tone, disconnected = glorious silence
## Power ## Power
The power supply provides the energy to drive the system *and* defines logical 1. 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: Can be a:
* Voltage Regulator (converts one potential to another) * Voltage Regulator (converts one potential to another)
* Batteries (Lemon, NiMH, LiPo) * Batteries
* Solar Panel * 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 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 ## $\mu$Controller
@ -185,10 +239,18 @@ Peripherals
: Vary chip to chip, but often include timers, radios, communication interfaces : Vary chip to chip, but often include timers, radios, communication interfaces
Seems complicated, but really simple. They literally read a command Seems complicated, but really simple. They literally read a command
(and data) from memory, then execute the command. At the end of the from memory, then execute the command. At the end of the
command, the next command is read from the next memory cell and the command, read the next command from the next memory cell and
process is repeat^[some commands change the next command memory address]
repeated^[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 # Let's start programming
@ -226,62 +288,62 @@ void loop() {
} }
~~~ ~~~
## Buzzer: Hardware <!-- ## Buzzer: Hardware -->
\begin{center} <!-- \begin{center} -->
\includegraphics[width=0.98\textwidth]{images/buzzer-breadboard.png} <!-- \includegraphics[width=0.98\textwidth]{images/buzzer-breadboard.png} -->
\end{center} <!-- \end{center} -->
## Buzzer: Software <!-- ## Buzzer: Software -->
~~~ C <!-- ~~~ C -->
#define BUZZER 8 /* Make BUZZER same as pin 8 */ <!-- #define BUZZER 8 /* Make BUZZER same as pin 8 */ -->
void setup() { <!-- void setup() { -->
pinMode(BUZZER, OUTPUT); <!-- pinMode(BUZZER, OUTPUT); -->
digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ <!-- digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ -->
} <!-- } -->
void loop() { <!-- void loop() { -->
digitalWrite(BUZZER, LOW); /* Turn on buzzer */ <!-- digitalWrite(BUZZER, LOW); /* Turn on buzzer */ -->
delay(100); /* wait for 100ms */ <!-- delay(100); /* wait for 100ms */ -->
digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ <!-- digitalWrite(BUZZER, HIGH); /* Turn off buzzer */ -->
delay(900); /* wait 900ms */ <!-- delay(900); /* wait 900ms */ -->
} <!-- } -->
~~~ <!-- ~~~ -->
## Push Button: Hardware <!-- ## Push Button: Hardware -->
\begin{center} <!-- \begin{center} -->
\includegraphics[width=0.98\textwidth]{images/buzzer-button-breadboard.png} <!-- \includegraphics[width=0.98\textwidth]{images/buzzer-button-breadboard.png} -->
\end{center} <!-- \end{center} -->
## Push Button: Software (Part 1) <!-- ## Push Button: Software (Part 1) -->
~~~ C <!-- ~~~ C -->
#define BUTTON 7 <!-- #define BUTTON 7 -->
#define BUZZER 8 <!-- #define BUZZER 8 -->
int button_state = 0; <!-- int button_state = 0; -->
void setup() { <!-- void setup() { -->
pinMode(BUTTON, INPUT); <!-- pinMode(BUTTON, INPUT); -->
pinMode(BUZZER, OUTPUT); <!-- pinMode(BUZZER, OUTPUT); -->
digitalWrite(BUZZER, HIGH); <!-- digitalWrite(BUZZER, HIGH); -->
} <!-- } -->
~~~ <!-- ~~~ -->
## Push Button: Software (Part 2) <!-- ## Push Button: Software (Part 2) -->
~~~ C <!-- ~~~ C -->
void loop() { <!-- void loop() { -->
button_state = digitalRead(BUTTON); <!-- button_state = digitalRead(BUTTON); -->
if (button_state == HIGH) { <!-- if (button_state == HIGH) { -->
digitalWrite(BUZZER, LOW); <!-- digitalWrite(BUZZER, LOW); -->
} else { <!-- } else { -->
digitalWrite(BUZZER, HIGH); <!-- digitalWrite(BUZZER, HIGH); -->
} <!-- } -->
} <!-- } -->
~~~ <!-- ~~~ -->
## The End? ## The End?

View File

@ -12,6 +12,7 @@ $endif$
\usepackage{ifxetex,ifluatex} \usepackage{ifxetex,ifluatex}
\usepackage{wrapfig} \usepackage{wrapfig}
\usepackage{siunitx} \usepackage{siunitx}
\usepackage{pdfpc-commands}
\usepackage{fixltx2e} % provides \textsubscript \usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}

View File

@ -8,9 +8,9 @@
by Shawn Nock by Shawn Nock
*/ */
#define RED 2 #define RED 6
#define GREEN 3 #define GREEN 5
#define BLUE 4 #define BLUE 3
int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000) int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000)

View File

@ -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);
}

View File

@ -11,9 +11,9 @@
#include <IRremote.h> #include <IRremote.h>
#include "medway-remote.h" // Button definitions for medway kit remote #include "medway-remote.h" // Button definitions for medway kit remote
#define RED 3 #define RED 6
#define GREEN 4 #define GREEN 5
#define BLUE 5 #define BLUE 3
#define IR_PIN 2 #define IR_PIN 2
#define BUZZER 10 #define BUZZER 10

View File

@ -9,9 +9,9 @@
by Shawn Nock by Shawn Nock
*/ */
#define RED 3 #define RED 6
#define GREEN 4 #define GREEN 5
#define BLUE 5 #define BLUE 3
int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000) int delay_ms = 1000; // How long to keep LEDs on and off in milliseconds (sec/1000)

View File

@ -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);
}