This digital notebook contains the handwritten notes by Akshansh Chaudhary.
The notes are a part of the course MFA Design + Technology.
MFADT was taught at Parsons School of Design, New York.
For more content and study material, visit https://www.akshansh.net/.
3. 28Aug2018
FirstHalf It
T T 1
Syllabus Arduino Javascript Unity
Midterm Makesth relatedwith Arduino
Final Presentation 8 Done
usingJavascript Unity
Grading
Attendance 204
Homework so
Midterm to 50
D
Resetbutton
USBOfp
cagyfgpfgqoundffdffrafv.vn
airesthosame V
Externalbatteryconnection toarduino as theilp
oArduino can
handle
up to 18V butforsafety keep 12 V
Akshansh Chaudhary 1 MFADT | Parsons School of Design
4. Bultmann.rand
LED Bum in thisfetchesthe Bthpinofthearduino
automatically o LED is connectedto it
o Thedatatransmissionrate in Arduinois measured interms
of BAUD Do thetransmission in Bitspersecond
Justas we have console in Js we have serialanointer
in Arduino To activate that use a similarpainther
command5
SerialpaintbnC is
pinnacleC 0 output
when
you
addthis andtothesetupfn it makesthe
correspondingpin as statedin 0 settothe value
of 5 V HIGH OU Low
Now in the voidloopc 3 s callthe
high low values tothepinusing
digitalwrite HIGH's f similarlyforloud
for IED use a resistance
of330 r
o Don't use a breadboard
forMIDTERM
Akshansh Chaudhary 2 MFADT | Parsons School of Design
6. O DULLUP vs PULLDOWN methods on Arduino 8Read
Bydefault theArduinois in PULLDOWN mode
ALWAYS ON LEDONLED
glows
i I
t.fi
ii
i
magma
i
Pushbuttonsanesthestate
afterclickSoevenwhenit
µor isnotpressed itstillhas
of
B
gjjj
a.ly
thEointqio
hihmahathe
fi.fi
s
A
it.si nnm
Sv Fi
T
f.it
1 s
m A
Akshansh Chaudhary 4 MFADT | Parsons School of Design
7. HOMEWORK
Dosomethingwith LED buttons on Arduino
Document
post it on theblog
Tryparallelarrangementin Arduino
inputs
Lf
Decked int Leo 13
pin
int l Geno
setup
pinRhode 0091007
troop digital
Read
Write
serialRead
Write
Akshansh Chaudhary 5 MFADT | Parsons School of Design
8. UNDERSTANDING ARDUINO
Case when I press thebutton both LEDs should
glow Parallel connection not using code
I M TbdHafadfofg.nggaunfwon.ir
loose resistor
1Arduino
HIT EYEL0 2
hurtand
whenbutton is not when buttonis pressed
pressed
I am only using thearduino
forpower GND Thecode
is not beingused in this circuit
Net Connect the ve endofboth the LEDs to a loose
resistorforthemto work
Akshansh Chaudhary 6 MFADT | Parsons School of Design
9. Case when I press thebutton both LEDs should
glow Sameresult as case
Series connection not taking any
code
g
info fromArduino
T.EEI
quinol I offing.ftp.m
GNDo
whenbutton is notpressed whenbutton is pressed
o I am only using thearduino
forpower GND Thecode
is not beingused in this circuit
Iot Connect the ve endofboththe LEDs to a loose
resistorforthemto work Theymaywork otherwisetoo
but may not betoo trust
Akshansh Chaudhary 7 MFADT | Parsons School of Design
10. Case
UtingAaduinoide
Create a trafficsignalusing LEDs
All LEDs
Pin7 RedLED
connected
inparallel
Pin4 yellow
LED
ii Flume
D
fEmTmf air areas
GO.NL
Ideag
Using
codeto switch LEDs alternately The redglows
first thenyellow finallygreen
Delay g i s i not all LEDsglow at a time
Akshansh Chaudhary 8 MFADT | Parsons School of Design
11. Case
UsingcodeinArduinols
when thebuttonispressedthe tipLEDglowswhen it is released thebottomLED
glowsIdea Connecting every LED inputto one ofthe
pins on an Arduino thenmanipulating
thebehavior
ofthosepinsthroughcode
Pins 243 manipulatethebehavior
oftheLEDs
i
onArduino
off D loose
now
hurland
whenbutton
EEis pressed
mggm
E
Tg
F
Ease
n.hmwhf.h.si
Pin7
Akshansh Chaudhary 9 MFADT | Parsons School of Design
12. UNDERSTANDING BUTTONS
A button Always
has 3connections
5V g GND
Pin input
A B
whenthebuttenis
AYO 1 pressed the
c D connection is
established
Buttonconnection
PConnedsApincArduinoPULLDOWNTYPE
one
LunoGNDV
QAresistowisimpfortte
button work It'sbetter
practice b have it towards
Notes
theground
Usuallychoose a value
ofresistor b w zoo Goon for
LED connections
Akshansh Chaudhary 10 MFADT | Parsons School of Design
13. PULLDOWN
PULLUP
whenbuttonis notpressed o whenthebuttonis pressed
SV SV
iHEfqo d Franz
F
i
PULL DOWN
whenbuttonis notpressed o whenthebuttonis pressed
Nothing to 3 M
s fifth
T
I I
Akshansh Chaudhary 11 MFADT | Parsons School of Design
15. 04Sept 2018
F separatepinsfordigital analog on an Arduino
Arduinois called a
µC Microcontroller
Using Potentiometer I use
analogi
usethepinsthat
can
of a
range
ofvalue The
pins have a
7 next to them
These are 9
3g NSg u bg
N9
N lOg n Il
Potentiometer It'stheanalog ilp device
Turning it changes
the ifp value
Connection
Et
Referencewdesites
o learnBasics
c L weCanD Adafient
ve Sparkfun
tsv analog
Akshansh Chaudhary 13 MFADT | Parsons School of Design
17. 10Sept 2018
Week2Homervorke
Idea Use a 4digit 7segmentLED to display a stopwatch
A button will startIstopthe stopwatch thedevices
whenthe timerreaches 10seconds the
fan powered
byDcmotorsshould run
Apotentiometerwould beconnectedtothemotorto
manageits rpm
whenthe timereaches 20seconds the servo motor
should startrunning
Atanypoint thebuttonshould turnthe einiut
on
off
7
segment
LED Arduinopin
u to98 T
fl Oo Pin11 3
HIB B Pin 7 4
HE lo WI
c pin y s
D
f I 2 3 95 6 D 5 Pin Z G
E Pin l 7
Aydin f Pinto 8
To activate digit I Pin 12 10 G E Pin 5 9CD2 digit2 Ping il
O Pin 3CD3 digits Pin 8 12 GDfeanial
4digit4 Pin b b
Akshansh Chaudhary 15 MFADT | Parsons School of Design
18. 11Sept 2018
A FewMidTeam
HidetheArduino
Don'tuse breadboardGoldeneverything
Bringthephysicaldevice
forthe PM
A Series Parallel connection
Fav a series connection therequirementofvoltage
exceeds fortheentire circuit So theArduino is not
sufficient topowerthe circuitCit can only ofp s v
eg
au I
forthis circuitfsay
Lund 9 V battery is
req
d
Personal Practice
Fainter with a button toactivate
differentstates on subsequentbuttonpress
Akshansh Chaudhary 16 MFADT | Parsons School of Design
19. Create a parallelconnection ofLEDs
Activate themdifferently
Using
Examples Control
Arrays
afewhopIteration
using
servo Motor
Jffinfles servo
Use a servolibrary
sweep
encludesservo h
Colonconvertion
GND
FEELY
su
Arduino
The in builtservo only
goes to Iso
Akshansh Chaudhary 17 MFADT | Parsons School of Design
21. P n
IF
Using Buzzer
MT hag2
Digital
0
Formatto 8
instead
of12
Homework
Use LCD music tocreate something
Thinkaboutmid termproject
Akshansh Chaudhary 19 MFADT | Parsons School of Design
22. May
Notes
libraryregdto use LCD includesLiquidCrystalh
Mentionthepins
you
wouldconnect
from Arduinoto LCD
liquidCrystal
Cod resetenable
digita digits digits DD
Mentionthe Lcd dimensions rows columns
lad beginClb
I sows
columns
Print
your
text on the Lcd
Is led printC Akshansh
To addtext a particularpartoftheLCD use this
4 led SetCursor Y
XIs now no.co i z
D startwitho
column no I o l 2 7
Ifyouprinta
longtext it won't concatenate tothe
next line
Akshansh Chaudhary 20 MFADT | Parsons School of Design
23. Usinguthasonicsensoeddea
whentheproximity reaches
10cm activatethe
RGB LED display a colorpattern
If 710cm turn offthe LED
Concept
Ultrasonic senor
It calculatesdistancebased
onecho
So thereal value
ofdistance
REBLED is thetotal12
f one
forreception
4Th
onefortransmit IBLUE
RED
GREEN
AND
Akshansh Chaudhary 21 MFADT | Parsons School of Design
24. 25Sept 2018
MIDTERM
Alternate VseAdriano nano It's smaller
Preferably9Don't use Arduino Uno
Don't use a breadboard Preferably Solder
Ideas forMid Term
UseAdafeuit kit
UseUnity withArduino
Use Processingwith Arduino
Firinalat Serial Communication
Fainato
UseProceeding as a master to connectwith Aereo
Master Slane
ARDUINO
File Examples 7Feimata StandardFeimalat
fFfffmpat
library Add library FirmataU
WINDOWS
ITcumentsProcessing libraries arduino examples aidedno input
Akshansh Chaudhary 22 MFADT | Parsons School of Design
25. Now turn thefile arduino inputpole
Next changetheportnumber
ofthe connection
like Arduinois
running on Port5
Ontheconsole
logofProcessing seethatthe
array shows Cota3 corn4 COMS
Oth I 1st
Element 2ndelement
ofthe
assay
So changethetextin thefilearduino input
changethe
array
number
Arduino list 2
Now when
you
seenthesketch it wouldshowthe
Arduino
input
Akshansh Chaudhary 23 MFADT | Parsons School of Design
26. Idea8PILEUP
Usingpulley gives a defaultHIGHvaluetothepin
So on activating thepin it makes it Low
To maketheaboveconnection in pulleys changethecode in
setup from INPUT INPUT PULLUP
change it
here
g
Theseinputsofarduino
get
highlighted
Now ifyou
connect a
ground to oneoftheseinputs it turns
toWCbecause
ofpulleys
GND
Pin4
Turnsoff
Akshansh Chaudhary 24 MFADT | Parsons School of Design
28. Connecting Processing to Arduino
Goto Processing
File7 Examples libraries Serial 7Simplewide
Update the ArduinoSerialPort
Make a new Arduino
file
copypastethecode written in exampletothe new
file Uploadthefile to Arduino
change the LED pin to 13
Run the Processing file
So now when we hoverover thesquare LEDpin13glows
O
LED pinB
Home over the
T
box
Akshansh Chaudhary 26 MFADT | Parsons School of Design
29. 02Oct2018
thidrojectototyping
CRT Panel Interaction
MuseumInstallation
Goodstuffto buy
T
square
scale
Arduino USBc USB mini
Soldering board
Soldering wire non Pb
wire strips
Coppertape
Brakeawaymetalpins
Rotary Encoder Sensor
0
Prototyping MaterialIdeas
Flashcards dice sharpie cardboard
PaperPrototyping
usuallydone
for
website
apps games
Akshansh Chaudhary 27 MFADT | Parsons School of Design
31. 23 Oct2018
TAVA PT
Is library Aprewritten Jsfileandloaded onthewebpage
sothatthecoding
simplifies
ex jQuery mostpopular
d3 best
fordatavesicalign
ps popular
forusingwithProcessing
threeis best
forusing3D on theweb
paper.js similar b ps
TOVERT
use headfromonlineresource mentionthat in
yourprogram
dauntedthefile copy in js
for Is we write document
getElementBy Id l Ig
forJQuery we
justwrite I S
Thenestis automaticallyunderstood
from
Mr
parameter
so
ry operatorobject
For Ts it doesn'tmatter whichquotation we use
or is upto us whateverworks
Akshansh Chaudhary 29 MFADT | Parsons School of Design
32. Create a 2 3
page
website
usingJQuery
practice ps
30Oct2018
JAVASCRIPT A JSON
ApplicationProgramming Interface
IDatabaseT
CAPT
o AM can bethoughtofas a
program
whichtakes userdata
getinfofrom a database
whenthe user connects tothedatabase
they
make a Query
Making thequery
Api call
AnAPI is a tableformat has instructions
Web APIformats JSON XML
Akshansh Chaudhary 30 MFADT | Parsons School of Design
33. API format
E
id e s
title s
data1
data2 g I
RESTfulsolution
RepresentationalStateTransferCREST
It is thestyle ofwriting an API in JSON or XML
Typesofrequest GET POST GETSid3
PUT idly DELETE id
Postman An appthat showstheJSONfile in a more
readableformat
Allows tocreate
your
own JSON
Alternate Open on Firefox doesautomatically
Sample IsONfile
on Firefox
Akshansh Chaudhary 31 MFADT | Parsons School of Design
34. O Tso N files needto be storedon a database thatis accessible
through an API call
So we can't use Google
Dewine
Gay forstoning calling
JSON
o AJAX Asynchronous JavaScript XML
It's ss in an asynchronousform whichdoes
API calls
o Good resource
for API examples codes
www programmableweb com
UseAPI to addcontentto the webpage
you
made lastweek check
Sturdy Ss jQuery Css detail Canvas
Use GET POSTrequest with the API
youcreate
Tryusing Google MapAM StarWars API GiphyAPI
check theslides
Akshansh Chaudhary 32 MFADT | Parsons School of Design
35. OfNov2018
UNITY
You can create 3D models on c4D
Maya 3DSMare or
Blender import them in Unity
UnrealEngine is a
game enginesimilarto Unity It is
verycommonlyused butrequires enormous computingpower
Monument Valley was made in Unity
Ifyougetlostwhile
navigating
selecttheobjectyou
want
to see
fromthehierarchy press f
Akshansh Chaudhary 33 MFADT | Parsons School of Design
36. Variable datatypes
4 int float string boolean vector3 s
array
gameObject
Ifyou want to
give an object a motor
you
use Vectors
Vectors have Y z directions
Voidstart 3 in Unity cc I
void setupC 3 in Processing
VoidupdateC 3 in Unity cc
void drawC I in Processing
Note Once
you
name a script don't change it later
The scriptreferences it inside so it
may
notwork
sooptname Class name insidethescript
Vector3 variable
for3D movement
Syntax publicVectors varName new Vector3Cx y 2
Gizmos are the 3 arrows thathelp navigate a 3D
space 7
f
f
x
Akshansh Chaudhary 34 MFADT | Parsons School of Design
37. Publicvariables in visualStudioshowautomatically in Unity
eg create a variable public Cohen
my
Colon
Now when
you add thatscriptto
anyobject
it will have an addndwindow changecolon
Allthese are
public variables in the
script
To
adjusttheposition access it in codethroughthe
transformpenepeity Transformposition
Gizmos DrawlineC cannotwork on the updateC g
fin vector3 is fordebugging
Note Thecolour variable
bydefaulthas an alpha value
set to 0 So it won't show So change it to 255
to beginseeingthecolor
Alpha
Channel
Akshansh Chaudhary 35 MFADT | Parsons School of Design
38. o Not Gizmos They are debugging
tools So they
don't show
up in Play Theyshow
up atthe
window isand automatically
Homework
Use Gizmostocreatelinesshapes
using visualstudiocode
InUnity
TryusingQuaternionRotation
Akshansh Chaudhary 36 MFADT | Parsons School of Design
39. I3 Nov2018
this a classusedtoidentifyobjects
eg this transformposition position
Vector3 format Anything withthatvariable
gives y 2
coordinates
In processing we do g x xpos.tt
orb
in Unity we do thistransform positition velocity
Is X T 2
Time dlttaTim
gameit took completethelastframe
To add a
gameObjectinsidecode use
public Gameobject target's
This willcreate a sectioninsideUnitywhere we
can
drag drop other objects
I
Akshansh Chaudhary 37 MFADT | Parsons School of Design
40. when we want toreference fall values from otherscripts
use Getcomponents C
like GetComponentsBounds
Is
if we wantto calla variableinside theother
script use
GetComponentsBounds c walls
for usingaudio create an AudioSource
drag dropsound
totheaudioclip area
Then totie thatto an object
create an audio variable in theobject'sscript
f link the AudioSource inside it
or
To add an oinagetextureto an object putit in the
Materials folder drag drop it to the NormalMap
undertheDefault Material
Akshansh Chaudhary 38 MFADT | Parsons School of Design
41. HOMEWORK I
4 Add drumbeatsinside a
boundingbox
to make music
Tryto makesomething with colliders
HOMEWORK 2
Practice Unity Rolla BallTutorial
Completetutorials on Lynda com
Akshansh Chaudhary 39 MFADT | Parsons School of Design
42. 27Nov2018
Using AUGMENTED REALITY in Unity
Setup
ReinstallUnity tickthe Vuforia
AugmentedReality
Support
Install of Vafaivaplugin is regal
Register on developer vufoaia.com
Create a new Developmentkey
Add a Database in theTargetManager
Add a
Target
choose This logo omgforthepackage
Download DatabaseCAD UnityEditor
IsThis packagegetsimported in Unity
AdvantageofVaforia
works on both Android iOS
1So
you
can develop
foriPhoneusing a Windows
tizen
Theapps are notas stable
Akshansh Chaudhary 40 MFADT | Parsons School of Design
43. Using Vuforia
Don't use main camera We usethePC camera
forsetting up AN Delete MainCamera
GameObject 7Vwforia Allcamera
Importeverything
Edit ProjectSettings 7 Player
4XR Settings 7 Tick UnforiaAugmentedReality
Importthepackagethat we made on the website
Add a GameObject Vuforia7Imag
thisFuld dm
G
Goto VafoiwaDeveloperPortal copythe app
license
key there
I
Akshansh Chaudhary 41 MFADT | Parsons School of Design
44. GotoImageTarget
Behavior Advanced DeviceTracker
Settings Global
Pastethe copiedlicense
key
there 7Addlicense
Make a cuke a
µ
childofImageTarget
Play
bring This logo in frontofthewebcam
Thecube we
justputherewouldlookforTNS
logo putthecubeones it on thewebcam
Cool
Akshansh Chaudhary 42 MFADT | Parsons School of Design
45. Understanding Scripting in Unity3D
Unity starts with creating a scene. Then, the scene must be made interactive. To do that, scripting is
required.
Linking objects to Scripts
The first part of scripting is to understand that whatever we create inside a script must be linked to the
object we are trying to interact with. The object - be it the camera, light or the gameObject must be
linked to the script.
To do that, add the script to the inspector window of the desired gameObject. Once that happens,•
any change done inside the script would automatically be understood as being done for that
gameObject.
For instance, if we want to change the size of a cube, we call the transform properties of that◦
cube. So, it would be Transform.position.z (to change the z coordinates). Using these codes
inside the script will automatically refer to the gameObject this is a part of.
It can be a gameObject, light, camera, particle effect, anything.
‣
Basically, this works for any object that allows MonoBehavior (almost all of them do).
‣
Public and Private Variables
Unity is pretty cool how it allows to change its menu. Let’s say we want to shoot a ball in air. So, we
must define these in the ball’s script: the force of shooting, the direction, and the start time (say).
The direction is something that would come from the Transform properties of the ball.
•
The force is not present in the inspector window. So, we have to create its menu such that, when the•
user is playing, we can adjust it in play mode.
To do that, we create a public variable inside the script. As soon as we declare a public variable◦
in Unity, the inspector window for the ball will automatically update to show the variable “Force”.
Now that we have a variable to tweak, we can refer it inside the script
◦
If we do not want a property to show in the inspector window, we use a private variable.
•
[SerializeField]: this is added before a private variable if we want it to show in the inspector◦
window, even though it is a private variable
Accessing gameObject properties and changing them
Now, we would create a gameObject, attach a script to it, and use that script to change transform the
object.
Coroutines in Unity
Coroutines are used when we want something to run at periodic intervals during a game. for instance,
making a canon shoot periodically.
The function used for Coroutines: IEnumerator
So, anything that is supposed to happen at periodic intervals should have be in this function (in
this case, it would be “private IEnumerator Shoot()”).
28Nov2018
Akshansh Chaudhary 43 MFADT | Parsons School of Design
46. 04Dec2018
Dylan's comments on thefinalproject
Ring
shouldhave a 8lb colorchange
bg audio
Environmentshould
give
a
flb
END OF COURSE
Akshansh Chaudhary 44 MFADT | Parsons School of Design