Professional Documents
Culture Documents
Primary Source: Arduino Language Reference: Arduino Programming Cheat Sheet
Primary Source: Arduino Language Reference: Arduino Programming Cheat Sheet
int1
int0
int (-32768 to 32767) 143 (Decimal)
SCL
SDA
begin() // join a master
long (-2147483648 to 2147483647) 0173 (Octal - base 8) begin(addr) // join a slave @ addr
unsigned char (0 to 255) 0b11011111 (Binary) requestFrom(address, count)
byte (0 to 255) 0x7B (Hexadecimal - base 16)
2
GND
13
12
~11
~10
~9
~6
~5
~3
AREF
TX1
RX0
beginTransmission(addr) // Step 1
unsigned int (0 to 65535) 7U (force unsigned) RESET DIGITAL (PWM~) send(myByte) // Step 2
word (0 to 65535) 10L (force long) send(char * mystring)
unsigned long (0 to 4294967295) 15UL (force long unsigned) L
float (-3.4028e+38 to 3.4028e+38) 10.0 (force floating point)
ARDUINO UNO send(byte * data, size)
endTransmission() // Step 3
double (currently same as float) 2.4e5 (2.4*10^5 = 240000)
TX ON
RX int available() // #bytes available
ICSP byte receive() // get next byte
Qualifiers 1 onReceive(handler)
Pointer Access
static (persists between calls) onRequest(handler)
& (reference: get a pointer)
volatile (in RAM (nice for ISR))
* (dereference: follow a pointer)
const (make read only)
PROGMEM (in flash) WWW.ARDUINO.CC - Made in Italy
Arrays
Strings ATmega382:
16MHz, 32KB Flash (prog.),
by Mark Liffiton
char S1[8] =
int myInts[6]; // array of 6 ints {'A','r','d','u','i','n','o'}; 2KB SRAM, 1KB EEPROM
int myPins[]={2, 4, 8, 3, 6}; // unterminated string; may crash Adapted from:
DC in POWER ANALOG IN
int mySensVals[6]={2, 4, -8, 3, 2}; char S2[8] = - Original by Gavin Smith
IOREF
RESET
3.3V
sugg. 7-12V
GND
GND
Vin
myInts[0]=42; // assigning first {'A','r','d','u','i','n','o','\0'}; - SVG version by Frederic Dufourg
5V
A0
A1
A2
A3
A4
A5
limit 6-20V
// index of myInts // includes \0 null termination
myInts[6]=12; // ERROR! Indexes char S3[]="Arduino"; - Arduino board drawing
original by Fritzing.org
SDA
SCL
// are 0 though 5 char S4[8]="Arduino";