• Non ci sono risultati.

2- ARDUINO PROGRAMMING PART1 SLIDES

N/A
N/A
Protected

Academic year: 2021

Condividi "2- ARDUINO PROGRAMMING PART1 SLIDES"

Copied!
13
0
0

Testo completo

(1)

Introduc)on  to    

Arduino  Programming  

(2)

references  

these  notes  borrow  from  .  .  .  

–  Arduino  web  site  

•  h@p://arduino.cc/en/Guide/Environment  

•  h@p://arduino.cc/en/Tutorial/HomePage  

–  Adafruit  tutorial  #1  and  2  

•  h@p://www.ladyada.net/learn/arduino/lesson2.html  

–  Leah  Buechley’s  Introduc)on  to  Arduino  

•  h@p://web.media.mit.edu/~leah/LilyPad/03_arduino_intro.html  

(3)

wri)ng  and  downloading  code  

(4)

running  Code  while  tethered  

(5)

running  code  stand-­‐alone  

(6)

Arduino  IDE  

IDE  =    Integrated                Development                Environment   http://www.arduino.cc/en/Guide/Environment! 6  

(7)

code  structure:  header  

header  provides  informa)on  and  

can  also  contain  code  

(8)

code  structure:  setup  func)on  

setup  func)on  is  executed   only  once  at  the  start  

(9)

code  structure:  loop  func)on  

loop  func)on  is  

repeated  indefinitely  

(10)

code  

digital  I/O  func)ons:  

•  pinMode  

•  digitalWrite  

•  digitalRead  

pinMode(13, Output)! prepares  pin  13  for  

outputs  of  voltage  

(11)

digitalWrite(13, HIGH)! sets  pin  13  to  a  voltage  that  

means  “on”    (five  volts  in  this  case)  

11  

code  

digital  I/O  func)ons:  

•  pinMode  

•  digitalWrite  

(12)

delay(1000);!

tells  microcontroller  to  do   nothing  for  1000  ms  =  1  s  

code  

12  

digital  I/O  func)ons:  

•  pinMode  

•  digitalWrite  

(13)

digitalWrite(13, LOW) ! sets  pin  13  to  voltage  

that  means  “off”  or  zero  volts  

13  

digital  I/O  func)ons:  

•  pinMode  

•  digitalWrite  

•  digitalRead  

Riferimenti

Documenti correlati

Tutti gli angoli alla circonferenza che insistono sullo stesso arco sono congruenti (infatti sono tutti congruenti alla meta' dello stesso angolo al centro). •

Muovendosi essenzialmente attorno a poche questioni – dalle caratteristiche che deve avere un balletto alle potenzialità del corpo danzante (specie se femminile), passando per

Il volume richiesto è il doppio del volume del solido generato dalla rotazione di 360° attorno all’asse x della porzione S di Σ che si trova nel primo quadrante... Si determini

Poiché ABP ed ACP hanno la stessa area e la base AP in comune, le altezze relative a tali lati (k ed m) sono uguali: ciò equivale a dire che la distanza di A dalla retta AM è

However, Vp/Vs ratio of 1.80, typical for ma fic rocks (average of values for this domain; Tables 1 & 2 ), may indicate that the central crustal domain could not be composed only

multiplicities for the mass symmetric region to zero compound nucleus excitation energy, the average number of prompt neutrons expected to be emitted in the spontaneous fission of