Difference between revisions of "Arduino"
Jump to navigation
Jump to search
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | == Arduino Language == |
+ | |||
+ | * [https://www.arduino.cc/reference/en/ Arduino language reference] | ||
+ | * <code>analogRead()</code> - [https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/ analogRead docs] | ||
+ | ** 0-4095 for 12 bits | ||
+ | ** On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second. | ||
+ | * <code>analogWrite()</code> - [https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/ AnalogWrite docs] | ||
+ | * <code>analogWriteResolution()</code> - [https://www.arduino.cc/reference/en/language/functions/zero-due-mkr-family/analogwriteresolution/ analogWriteResolution docs] | ||
+ | |||
+ | === Port Registers === | ||
+ | * [https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation] | ||
+ | * Use only if: | ||
+ | ** You need to turn pins on and off very quickly, meaning within fractions of a microsecond | ||
+ | ** You need to set multiple output pins at the same time | ||
+ | ** You're running low on program memory | ||
+ | ** Otherwise use <code>digitalRead()</code> and <code>digitalWrite()</code> for more readable, portable code. | ||
+ | * DDRx - data direction register (r/w) | ||
+ | ** You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRx register or with <code>pinMode()</code>. | ||
+ | * PORTx - data register (r/w) | ||
+ | * PINx - Read all of the digital input pins at the same time - read only | ||
+ | |||
+ | |||
+ | === Timer Interrupts === | ||
+ | * [https://www.instructables.com/Arduino-Timer-Interrupts/ Arduino Timer Interrupts] | ||
+ | |||
+ | == Microcontroller concepts == | ||
* SPI bus | * SPI bus | ||
* Digital IO/PWM | * Digital IO/PWM | ||
+ | * UART | ||
+ | * [https://learn.sparkfun.com/tutorials/terminal-basics/all Serial Terminal Basics] | ||
==Libraries== | ==Libraries== | ||
Line 7: | Line 34: | ||
* [https://github.com/prenticedavid/MCUFRIEND_kbv MCUfriend kbv shield] | * [https://github.com/prenticedavid/MCUFRIEND_kbv MCUfriend kbv shield] | ||
* [https://learn.adafruit.com/arduino-tips-tricks-and-techniques/arduino-libraries Installing libraries] | * [https://learn.adafruit.com/arduino-tips-tricks-and-techniques/arduino-libraries Installing libraries] | ||
+ | * [https://www.arduino.cc/en/Guide/Libraries Arduino Libraries guide]] | ||
+ | * [https://www.arduino.cc/en/Reference/Libraries Arduino Library reference] | ||
+ | * [https://www.pjrc.com/teensy/td_libs_Audio.html Teensy Audio Library] | ||
+ | ** [https://www.pjrc.com/teensy/gui/index.html?info=AudioRecordQueue Audio System Design Tool for Teensy Audio Library] | ||
+ | * [https://circuitcellar.com/research-design-hub/fancy-filtering-with-the-teensy-3-6 guitar amp emulation using teensy] | ||
==Arduino Mega 2560== | ==Arduino Mega 2560== | ||
* [https://www.microchip.com/wwwproducts/en/ATmega2560 ATmega2560 Microcontroller specs] - 8-bit processor | * [https://www.microchip.com/wwwproducts/en/ATmega2560 ATmega2560 Microcontroller specs] - 8-bit processor |
Latest revision as of 04:29, 24 February 2021
Contents
Arduino Language
- Arduino language reference
analogRead()
- analogRead docs- 0-4095 for 12 bits
- On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.
analogWrite()
- AnalogWrite docsanalogWriteResolution()
- analogWriteResolution docs
Port Registers
- Port Manipulation
- Use only if:
- You need to turn pins on and off very quickly, meaning within fractions of a microsecond
- You need to set multiple output pins at the same time
- You're running low on program memory
- Otherwise use
digitalRead()
anddigitalWrite()
for more readable, portable code.
- DDRx - data direction register (r/w)
- You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRx register or with
pinMode()
.
- You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRx register or with
- PORTx - data register (r/w)
- PINx - Read all of the digital input pins at the same time - read only
Timer Interrupts
Microcontroller concepts
- SPI bus
- Digital IO/PWM
- UART
- Serial Terminal Basics
Libraries
- Adafruit GFX library
- MCUfriend kbv shield
- Installing libraries
- Arduino Libraries guide]
- Arduino Library reference
- Teensy Audio Library
- guitar amp emulation using teensy
Arduino Mega 2560
- ATmega2560 Microcontroller specs - 8-bit processor