
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Typology: Cheat Sheet
1 / 1
This page cannot be seen from the preview
Don't miss anything!
/* Each Arduino sketch must contain the following two functions. */
/* this code runs once at the beginning of the code execution. */
/* this code runs repeatedly over and over as long as the board is powered. */
/* Sets the mode of the digital I/O pin. It can be set as an input, output, or an input with an internal pull-up resistor. */
// if condition is TRUE, do something here
// otherwise, do this
// do this
/* The ‘for’ statement is used to repeat a block of statements enclosed in curly braces. An increment counter is usually used to increment and terminate the loop. */
/* val = HIGH or LOW write a HIGH or a LOW value to a digital pin. */
/* Reads the value from a specified digital pin, either HIGH or LOW. */
/* Writes an analog value to a pin. val = integer value from 0 to 255 */
/* Reads the value from the specified analog pin. */
/* Generates a square wave of the specified frequency to a pin. Pin must be one of the PWM (~) pins. */
/* Generates a square wave of the specified frequency to a pin for a duration in milliseconds. Pin must be one of the PWM (~) pins. */
// Turns off the tone on the pin.
/* Pauses the program for the amount of time (in milliseconds). */
/* Pauses the program for the amount of time (in microseconds). */
/* Returns the number of milliseconds since the board began running the current program. max: 4,294,967,295 */
/* Returns the number of microseconds since the board began running the current program. max: 4,294,967,295 */
to 2,147,483,647, signed */
/* this provides access to special additional functions for things such as servo motors, SD card, wifi, or bluetooth. */
ATmega Microcontroller
Temperature Sensor
Button Vibe Motor
RGB LED Switch
Light Sensor
Buzzer/ Speaker
LEDs (Light Emitting Diodes)
Power In
Power 5V / 3.3 / GND
USB to Computer
Reset
Analog Inputs
SCL/SDA (I2C Bus)
ATmega Microcontroller
Digital I/O PWM(3,5,6,9,10,11)