SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
Structure
void setup() void loop()
Control Structures
if (x<5){ } else { }
switch (myvar) {
case 1:
break;
case 2:
break;
default:
}
for (int i=0; i <= 255; i++){ }
while (x<5){ }
do { } while (x<5);
continue; //Go to next in do/for/while loop
return x; // Or ‘return;’ for voids.
goto
// considered harmful :-)
Further Syntax
// (single line comment)
/* (multi-line comment) */
#define DOZEN 12 //Not baker’s!
#include <avr/pgmspace.h>
General Operators
= (assignment operator)
+ (addition)
- (subtraction)
* (multiplication) / (division)
% (modulo)
== (equal to)
!= (not equal to)
< (less than)
> (greater than)
<= (less than or equal to)
>= (greater than or equal to)
&& (and) || (or)
! (not)
Pointer Access
& reference operator
* dereference operator

Bitwise Operators
& (bitwise and) | (bitwise or)
^ (bitwise xor) ~ (bitwise not)
<< (bitshift left) >> (bitshift right)
Compound Operators
++ (increment) -- (decrement)
+= (compound addition)
-= (compound subtraction)
*= (compound multiplication)
/= (compound division)
&= (compound bitwise and)
|= (compound bitwise or)

ATMega168 ATMega328 ATmega1280

Arduino Cheat Sheet V.02c

Flash (2k for
boobtloader)
SRAM
EEPROM

Mostly taken from the extended reference:
http://arduino.cc/en/Reference/Extended
Gavin Smith – Robots and Dinosaurs, The Sydney Hackspace
Constants
HIGH | LOW
INPUT | OUTPUT
true | false
143 // Decimal number
0173 // Octal number
0b11011111 //Binary
0x7B // Hex number
7U // Force unsigned
10L // Force long
15UL // Force long unsigned
10.0 // Forces floating point
2.4e5 // 240000
Data Types
void
boolean
(0, 1, false, true)
char (e.g. ‘a’ -128 to 127)
unsigned char (0 to 255)
byte (0 to 255)
int
(-32,768 to 32,767)
unsigned int (0 to 65535)
word (0 to 65535)
long
(-2,147,483,648 to
2,147,483,647)
unsigned long (0 to 4,294,967,295)
float
(-3.4028235E+38 to
3.4028235E+38)
double (currently same as float)
sizeof(myint) // returns 2 bytes
Strings
char S1[15];
char S2[8]={'a','r','d','u','i','n','o'};
char S3[8]={'a','r','d','u','i','n','o','0'};
//Included 0 null termination
char S4[ ] = "arduino";
char S5[8] = "arduino";
char S6[15] = "arduino";

Qualifiers
static // persists between calls
volatile // use RAM (nice for ISR)
const // make read-only
PROGMEM // use flash
Digital I/O
pinMode(pin, [INPUT,OUTPUT])
digitalWrite(pin, value)
int digitalRead(pin)
//Write High to inputs to use pull-up res
Analog I/O
analogReference([DEFAULT,INTERNA
L,EXTERNAL])
int analogRead(pin) //Call twice if
switching pins from high Z source.
analogWrite(pin, value) // PWM
Advanced I/O
tone(pin, freqhz)
tone(pin, freqhz ,duration_ms)
noTone(pin)
shiftOut(dataPin, clockPin,
[MSBFIRST,LSBFIRST], value)
unsigned long pulseIn(pin, [HIGH,LOW])
Time
unsigned long millis() // 50 days overflow.
unsigned long micros() // 70 min overflow
delay(ms)
delayMicroseconds(us)
Math
min(x, y) max(x, y)
abs(x)
constrain(x, minval, maxval )
map(val, fromL, fromH, toL, toH)
pow(base, exponent) sqrt(x)
sin(rad)
cos(rad)
tan(rad)

Arrays
int myInts[6];
int myPins[] = {2, 4, 8, 3, 6};
int mySensVals[6] = {2, 4, -8, 3, 2};

Random Numbers
randomSeed(seed) // Long or int
long random(max)
long random(min, max)

Conversion
char()
byte()
int()
word()
long()
float()

Bits and Bytes
lowByte()
highByte()
bitRead(x,bitn) bitWrite(x,bitn,bit)
bitSet(x,bitn)
bitClear(x,bitn)
bit(bitn) //bitn: 0-LSB 7-MSB

External Interrupts
attachInterrupt(interrupt, function,
[LOW,CHANGE,RISING,FALLING])
detachInterrupt(interrupt)
interrupts()
noInterrupts()

32kB
2kB
1kB

# of IO

Duemilanove/
Nano/ Pro/
ProMini
14 + 6 analog
(Nano has 14+8)

Serial Pins

0 - RX
1 - TX

Ext Interrupts

Libraries:
PWM pins

Serial.
begin([300, 1200, 2400, 4800, 9600,
14400, 19200, 28800, 38400, 57600,
115200])
end()
int available()
int read()
flush()
print()
println()
write()

16kB
1kB
512B

SPI
I2C

2 - (Int 0)
3 - (Int 1)
5,6 - Timer 0
9,10 - Timer 1
3,11 - Timer 2
10 - SS
11 - MOSI
12 - MISO
13 - SCK
Analog4 - SDA
Analog5 - SCK

128kB
8kB
4kB

Mega
54 + 16 analog
0 - RX1 1 - TX1
19 - RX2 18 - TX2
17 - RX3 16 - TX3
15 - RX4 14 - TX4
2,3,21,20,19,18
(IRQ0- IRQ5)

0-13
53 - SS
51 - MOSI
50 - MISO
52 - SCK
20 - SDA
21 - SCL

EEPROM (#include <EEPROM.h>)
byte read(intAddr)
write(intAddr,myByte)
Servo (#include <Servo.h>)
attach(pin , [min_uS, max_uS])
write(angle) // 0-180
writeMicroseconds(uS) //1000-2000,
1500 is midpoint
read() // 0-180
attached() //Returns boolean
detach()
SoftwareSerial(RxPin,TxPin)
// #include<SoftwareSerial.h>
begin(longSpeed) // up to 9600
char read() // blocks till data
print(myData) or println(myData)
Wire (#include <Wire.h>) // For I2C
begin()
// Join as master
begin(addr) // Join as slave @ addr
requestFrom(address, count)
beginTransmission(addr) // Step 1
send(mybyte)
// Step 2
send(char * mystring)
send(byte * data, size)
endTransmission()
// Step 3
byte available() // Num of bytes
byte receive() //Return next byte
onReceive(handler)
onRequest(handler)

From
Arduino.CC

Pics from Fritzing.Org under C.C. license

Weitere ähnliche Inhalte

Was ist angesagt?

05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional StatementsIntro C# Book
 
C++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsC++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsMohammad Shaker
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationEelco Visser
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control StructureMohammad Shaker
 
Declare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsDeclare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsEelco Visser
 
Erlang bootstrap course
Erlang bootstrap courseErlang bootstrap course
Erlang bootstrap courseMartin Logan
 
Gophercon 2016 Communicating Sequential Goroutines
Gophercon 2016 Communicating Sequential GoroutinesGophercon 2016 Communicating Sequential Goroutines
Gophercon 2016 Communicating Sequential GoroutinesAdrian Cockcroft
 
12. Exception Handling
12. Exception Handling 12. Exception Handling
12. Exception Handling Intro C# Book
 
Rx: Curing Your Asynchronous Programming Blues | QCon London
Rx: Curing Your Asynchronous Programming Blues |  QCon LondonRx: Curing Your Asynchronous Programming Blues |  QCon London
Rx: Curing Your Asynchronous Programming Blues | QCon LondonJiby John
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonMarian Marinov
 

Was ist angesagt? (20)

Multirate sim
Multirate simMultirate sim
Multirate sim
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
 
C++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsC++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+Operators
 
06.Loops
06.Loops06.Loops
06.Loops
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter Generation
 
Lập trình C
Lập trình CLập trình C
Lập trình C
 
C++ L06-Pointers
C++ L06-PointersC++ L06-Pointers
C++ L06-Pointers
 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
Declare Your Language: Dynamic Semantics
Declare Your Language: Dynamic SemanticsDeclare Your Language: Dynamic Semantics
Declare Your Language: Dynamic Semantics
 
Erlang bootstrap course
Erlang bootstrap courseErlang bootstrap course
Erlang bootstrap course
 
C++ L04-Array+String
C++ L04-Array+StringC++ L04-Array+String
C++ L04-Array+String
 
Gophercon 2016 Communicating Sequential Goroutines
Gophercon 2016 Communicating Sequential GoroutinesGophercon 2016 Communicating Sequential Goroutines
Gophercon 2016 Communicating Sequential Goroutines
 
12. Exception Handling
12. Exception Handling 12. Exception Handling
12. Exception Handling
 
C++ L11-Polymorphism
C++ L11-PolymorphismC++ L11-Polymorphism
C++ L11-Polymorphism
 
verilog code
verilog codeverilog code
verilog code
 
06 Loops
06 Loops06 Loops
06 Loops
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
Rx: Curing Your Asynchronous Programming Blues | QCon London
Rx: Curing Your Asynchronous Programming Blues |  QCon LondonRx: Curing Your Asynchronous Programming Blues |  QCon London
Rx: Curing Your Asynchronous Programming Blues | QCon London
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Ähnlich wie Arduino

Documento de acrobat2
Documento de acrobat2Documento de acrobat2
Documento de acrobat2fraytuck
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثةشرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثةجامعة القدس المفتوحة
 
Goroutines and Channels in practice
Goroutines and Channels in practiceGoroutines and Channels in practice
Goroutines and Channels in practiceGuilherme Garnier
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency명신 김
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ applicationDaniele Pallastrelli
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C BasicsBharat Kalia
 
エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理maruyama097
 
Austin c-c++-meetup-feb2018-spectre
Austin c-c++-meetup-feb2018-spectreAustin c-c++-meetup-feb2018-spectre
Austin c-c++-meetup-feb2018-spectreKim Phillips
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)yap_raiza
 
Intro to c chapter cover 1 4
Intro to c chapter cover 1 4Intro to c chapter cover 1 4
Intro to c chapter cover 1 4Hazwan Arif
 
tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会RyoyaKatafuchi
 
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...Marco Balduzzi
 

Ähnlich wie Arduino (20)

Documento de acrobat2
Documento de acrobat2Documento de acrobat2
Documento de acrobat2
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثةشرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
 
Buffer OverFlow
Buffer OverFlowBuffer OverFlow
Buffer OverFlow
 
Python 1 liners
Python 1 linersPython 1 liners
Python 1 liners
 
Python
PythonPython
Python
 
Goroutines and Channels in practice
Goroutines and Channels in practiceGoroutines and Channels in practice
Goroutines and Channels in practice
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ application
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Cbasic
CbasicCbasic
Cbasic
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理エンタープライズ・クラウドと 並列・分散・非同期処理
エンタープライズ・クラウドと 並列・分散・非同期処理
 
Austin c-c++-meetup-feb2018-spectre
Austin c-c++-meetup-feb2018-spectreAustin c-c++-meetup-feb2018-spectre
Austin c-c++-meetup-feb2018-spectre
 
Sysprog 11
Sysprog 11Sysprog 11
Sysprog 11
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
 
Jamming attack in wireless network
Jamming attack in wireless networkJamming attack in wireless network
Jamming attack in wireless network
 
Intro to c chapter cover 1 4
Intro to c chapter cover 1 4Intro to c chapter cover 1 4
Intro to c chapter cover 1 4
 
tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会
 
Interesting facts on c
Interesting facts on cInteresting facts on c
Interesting facts on c
 
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
 

Mehr von Desiree Santos

Efetividade na névoa conectando bits e bytes
Efetividade na névoa  conectando bits e bytesEfetividade na névoa  conectando bits e bytes
Efetividade na névoa conectando bits e bytesDesiree Santos
 
Internet das coisas na prática
Internet das coisas na práticaInternet das coisas na prática
Internet das coisas na práticaDesiree Santos
 
Programando arduino com javascript
Programando arduino com javascriptProgramando arduino com javascript
Programando arduino com javascriptDesiree Santos
 
Internet das coisas - ADP TecnoTalks
Internet das coisas - ADP TecnoTalksInternet das coisas - ADP TecnoTalks
Internet das coisas - ADP TecnoTalksDesiree Santos
 
SenacTalks - Mulheres na tecnologia
SenacTalks - Mulheres na tecnologia SenacTalks - Mulheres na tecnologia
SenacTalks - Mulheres na tecnologia Desiree Santos
 
Internet das coisas - Oportunidades & Inovação
Internet das coisas - Oportunidades & InovaçãoInternet das coisas - Oportunidades & Inovação
Internet das coisas - Oportunidades & InovaçãoDesiree Santos
 
Grace Hopper - Internet of Things from A to Z
Grace Hopper - Internet of Things from A to ZGrace Hopper - Internet of Things from A to Z
Grace Hopper - Internet of Things from A to ZDesiree Santos
 
Internet das Coisas - Cafeteira hacker
Internet das Coisas - Cafeteira hackerInternet das Coisas - Cafeteira hacker
Internet das Coisas - Cafeteira hackerDesiree Santos
 
Seminário de robótica - PUCRS
Seminário de robótica - PUCRSSeminário de robótica - PUCRS
Seminário de robótica - PUCRSDesiree Santos
 
Nodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptNodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptDesiree Santos
 
Inove com Internet das Coisas
Inove com Internet das CoisasInove com Internet das Coisas
Inove com Internet das CoisasDesiree Santos
 
Internet das Coisas (Internet of Things - IoT)
Internet das Coisas (Internet of Things - IoT)Internet das Coisas (Internet of Things - IoT)
Internet das Coisas (Internet of Things - IoT)Desiree Santos
 
LevelUp program - Framework to retain talent
LevelUp program - Framework to retain talentLevelUp program - Framework to retain talent
LevelUp program - Framework to retain talentDesiree Santos
 
Domótica: Controle dispositivos via comando de voz com arduino
Domótica: Controle dispositivos via comando de voz com arduinoDomótica: Controle dispositivos via comando de voz com arduino
Domótica: Controle dispositivos via comando de voz com arduinoDesiree Santos
 

Mehr von Desiree Santos (20)

Efetividade na névoa conectando bits e bytes
Efetividade na névoa  conectando bits e bytesEfetividade na névoa  conectando bits e bytes
Efetividade na névoa conectando bits e bytes
 
Arduino
ArduinoArduino
Arduino
 
Internet das coisas na prática
Internet das coisas na práticaInternet das coisas na prática
Internet das coisas na prática
 
Programando arduino com javascript
Programando arduino com javascriptProgramando arduino com javascript
Programando arduino com javascript
 
Internet das coisas - ADP TecnoTalks
Internet das coisas - ADP TecnoTalksInternet das coisas - ADP TecnoTalks
Internet das coisas - ADP TecnoTalks
 
SenacTalks - Mulheres na tecnologia
SenacTalks - Mulheres na tecnologia SenacTalks - Mulheres na tecnologia
SenacTalks - Mulheres na tecnologia
 
Internet das coisas - Oportunidades & Inovação
Internet das coisas - Oportunidades & InovaçãoInternet das coisas - Oportunidades & Inovação
Internet das coisas - Oportunidades & Inovação
 
Grace Hopper - Internet of Things from A to Z
Grace Hopper - Internet of Things from A to ZGrace Hopper - Internet of Things from A to Z
Grace Hopper - Internet of Things from A to Z
 
Internet das Coisas - Cafeteira hacker
Internet das Coisas - Cafeteira hackerInternet das Coisas - Cafeteira hacker
Internet das Coisas - Cafeteira hacker
 
Seminário de robótica - PUCRS
Seminário de robótica - PUCRSSeminário de robótica - PUCRS
Seminário de robótica - PUCRS
 
Nodebot day lamp
Nodebot day lampNodebot day lamp
Nodebot day lamp
 
Robots
RobotsRobots
Robots
 
Nodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptNodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascript
 
Inove com Internet das Coisas
Inove com Internet das CoisasInove com Internet das Coisas
Inove com Internet das Coisas
 
Quilombolas
QuilombolasQuilombolas
Quilombolas
 
Internet das Coisas (Internet of Things - IoT)
Internet das Coisas (Internet of Things - IoT)Internet das Coisas (Internet of Things - IoT)
Internet das Coisas (Internet of Things - IoT)
 
LevelUp program - Framework to retain talent
LevelUp program - Framework to retain talentLevelUp program - Framework to retain talent
LevelUp program - Framework to retain talent
 
Domótica: Controle dispositivos via comando de voz com arduino
Domótica: Controle dispositivos via comando de voz com arduinoDomótica: Controle dispositivos via comando de voz com arduino
Domótica: Controle dispositivos via comando de voz com arduino
 
Arduino
ArduinoArduino
Arduino
 
Robótica com Arduino
Robótica com ArduinoRobótica com Arduino
Robótica com Arduino
 

Kürzlich hochgeladen

(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...Sanjna Singh
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceanilsa9823
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...CIOWomenMagazine
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theorydrae5
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceanilsa9823
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改atducpo
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..nishakur201
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfnoumannajam04
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceanilsa9823
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfJess Walker
 
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceanilsa9823
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushShivain97
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndPooja Nehwal
 
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...gurkirankumar98700
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666nishakur201
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改atducpo
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girlsPooja Nehwal
 

Kürzlich hochgeladen (20)

(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
 
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdf
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
 
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by Mindbrush
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
 
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 

Arduino

  • 1. Structure void setup() void loop() Control Structures if (x<5){ } else { } switch (myvar) { case 1: break; case 2: break; default: } for (int i=0; i <= 255; i++){ } while (x<5){ } do { } while (x<5); continue; //Go to next in do/for/while loop return x; // Or ‘return;’ for voids. goto // considered harmful :-) Further Syntax // (single line comment) /* (multi-line comment) */ #define DOZEN 12 //Not baker’s! #include <avr/pgmspace.h> General Operators = (assignment operator) + (addition) - (subtraction) * (multiplication) / (division) % (modulo) == (equal to) != (not equal to) < (less than) > (greater than) <= (less than or equal to) >= (greater than or equal to) && (and) || (or) ! (not) Pointer Access & reference operator * dereference operator Bitwise Operators & (bitwise and) | (bitwise or) ^ (bitwise xor) ~ (bitwise not) << (bitshift left) >> (bitshift right) Compound Operators ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) &= (compound bitwise and) |= (compound bitwise or) ATMega168 ATMega328 ATmega1280 Arduino Cheat Sheet V.02c Flash (2k for boobtloader) SRAM EEPROM Mostly taken from the extended reference: http://arduino.cc/en/Reference/Extended Gavin Smith – Robots and Dinosaurs, The Sydney Hackspace Constants HIGH | LOW INPUT | OUTPUT true | false 143 // Decimal number 0173 // Octal number 0b11011111 //Binary 0x7B // Hex number 7U // Force unsigned 10L // Force long 15UL // Force long unsigned 10.0 // Forces floating point 2.4e5 // 240000 Data Types void boolean (0, 1, false, true) char (e.g. ‘a’ -128 to 127) unsigned char (0 to 255) byte (0 to 255) int (-32,768 to 32,767) unsigned int (0 to 65535) word (0 to 65535) long (-2,147,483,648 to 2,147,483,647) unsigned long (0 to 4,294,967,295) float (-3.4028235E+38 to 3.4028235E+38) double (currently same as float) sizeof(myint) // returns 2 bytes Strings char S1[15]; char S2[8]={'a','r','d','u','i','n','o'}; char S3[8]={'a','r','d','u','i','n','o','0'}; //Included 0 null termination char S4[ ] = "arduino"; char S5[8] = "arduino"; char S6[15] = "arduino"; Qualifiers static // persists between calls volatile // use RAM (nice for ISR) const // make read-only PROGMEM // use flash Digital I/O pinMode(pin, [INPUT,OUTPUT]) digitalWrite(pin, value) int digitalRead(pin) //Write High to inputs to use pull-up res Analog I/O analogReference([DEFAULT,INTERNA L,EXTERNAL]) int analogRead(pin) //Call twice if switching pins from high Z source. analogWrite(pin, value) // PWM Advanced I/O tone(pin, freqhz) tone(pin, freqhz ,duration_ms) noTone(pin) shiftOut(dataPin, clockPin, [MSBFIRST,LSBFIRST], value) unsigned long pulseIn(pin, [HIGH,LOW]) Time unsigned long millis() // 50 days overflow. unsigned long micros() // 70 min overflow delay(ms) delayMicroseconds(us) Math min(x, y) max(x, y) abs(x) constrain(x, minval, maxval ) map(val, fromL, fromH, toL, toH) pow(base, exponent) sqrt(x) sin(rad) cos(rad) tan(rad) Arrays int myInts[6]; int myPins[] = {2, 4, 8, 3, 6}; int mySensVals[6] = {2, 4, -8, 3, 2}; Random Numbers randomSeed(seed) // Long or int long random(max) long random(min, max) Conversion char() byte() int() word() long() float() Bits and Bytes lowByte() highByte() bitRead(x,bitn) bitWrite(x,bitn,bit) bitSet(x,bitn) bitClear(x,bitn) bit(bitn) //bitn: 0-LSB 7-MSB External Interrupts attachInterrupt(interrupt, function, [LOW,CHANGE,RISING,FALLING]) detachInterrupt(interrupt) interrupts() noInterrupts() 32kB 2kB 1kB # of IO Duemilanove/ Nano/ Pro/ ProMini 14 + 6 analog (Nano has 14+8) Serial Pins 0 - RX 1 - TX Ext Interrupts Libraries: PWM pins Serial. begin([300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200]) end() int available() int read() flush() print() println() write() 16kB 1kB 512B SPI I2C 2 - (Int 0) 3 - (Int 1) 5,6 - Timer 0 9,10 - Timer 1 3,11 - Timer 2 10 - SS 11 - MOSI 12 - MISO 13 - SCK Analog4 - SDA Analog5 - SCK 128kB 8kB 4kB Mega 54 + 16 analog 0 - RX1 1 - TX1 19 - RX2 18 - TX2 17 - RX3 16 - TX3 15 - RX4 14 - TX4 2,3,21,20,19,18 (IRQ0- IRQ5) 0-13 53 - SS 51 - MOSI 50 - MISO 52 - SCK 20 - SDA 21 - SCL EEPROM (#include <EEPROM.h>) byte read(intAddr) write(intAddr,myByte) Servo (#include <Servo.h>) attach(pin , [min_uS, max_uS]) write(angle) // 0-180 writeMicroseconds(uS) //1000-2000, 1500 is midpoint read() // 0-180 attached() //Returns boolean detach() SoftwareSerial(RxPin,TxPin) // #include<SoftwareSerial.h> begin(longSpeed) // up to 9600 char read() // blocks till data print(myData) or println(myData) Wire (#include <Wire.h>) // For I2C begin() // Join as master begin(addr) // Join as slave @ addr requestFrom(address, count) beginTransmission(addr) // Step 1 send(mybyte) // Step 2 send(char * mystring) send(byte * data, size) endTransmission() // Step 3 byte available() // Num of bytes byte receive() //Return next byte onReceive(handler) onRequest(handler) From Arduino.CC Pics from Fritzing.Org under C.C. license