• Non ci sono risultati.

2- ARDUINO PROGRAMMING PART1

N/A
N/A
Protected

Academic year: 2021

Condividi "2- ARDUINO PROGRAMMING PART1"

Copied!
13
0
0

Testo completo

(1)

Introduction to

Arduino Programming

(2)

references

these notes borrow from . . .

– Arduino web site

• http://arduino.cc/en/Guide/Environment • http://arduino.cc/en/Tutorial/HomePage

– Adafruit tutorial #1 and 2

• http://www.ladyada.net/learn/arduino/lesson2.html

– Leah Buechley’s Introduction to Arduino

• http://web.media.mit.edu/~leah/LilyPad/03_arduino_intro.html

(3)

writing 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 information and

can also contain code

(8)

code structure: setup function

setup function is executed only once at the start

(9)

code structure: loop function

loop function is

repeated indefinitely

(10)

code

digital I/O functions: • 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 functions: • pinMode

• digitalWrite • digitalRead

(12)

delay(1000);

tells microcontroller to do nothing for 1000 ms = 1 s

code

12 digital I/O functions:

• pinMode • digitalWrite • digitalRead

(13)

digitalWrite(13, LOW)

sets pin 13 to voltage

that means “off” or zero volts

13 digital I/O functions:

• pinMode • digitalWrite • digitalRead

Riferimenti

Documenti correlati

This was the main reason for many epistolary precept-books to become exclusively didactic in their intent, and aiming at quick and efficient recipes presented in the form of

 A regression algorithm is used to predict the value of a continuous attribute (the target attribute) by applying a model on the..

Figure S4: TBX5 in breast cancer; Table S1: Biomarkers for the prediction of distant metastasis in primary tumors; Table S2: List of genes selected by AUC and OVL in comparison of

più felici delle sceneggiature, che Goldoni e Teodora Medebach, la prima attrice della compagnia, discorrano sul teatro: dal complesso rapporto con il pubblico alla

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

Department of Physics, University of Oxford, Oxford, United Kingdom 58 Massachusetts Institute of Technology, Cambridge, MA, United States 59 University of Cincinnati, Cincinnati,

Subtyping patients to either BAH or APA groups was based on calculations of the lateralization ratio, according to immunoassay measurements of plasma aldosterone (A) and cortisol

To further analyze possible sources of BP exposure, non-parametric correla- tions (Spearman correlations) were performed between BP levels and three groups of inde- pendent