build-lists: true autoscale: true
#Advanced Arduino
###(or Arduino and iOS)
####Andrew Madsen ####CocoaHeads SLC - May 5, 2015
#What I’ll Cover
- Arduino <-> Peripheral Communication
- Bluetooth 4.0
- Communication with iOS apps
- Beyond prototyping
#First, A Quick Recap
Arduino is an easy to use microcontroller.
#Why Arduino?
- No boilerplate required.
- Get up and running very quickly.
- Tons of pre-designed peripherals.
- Lots of easy to use libraries.
- Open source software and hardware.
- Huge community
#More basic info:
###https://github.com/armadsen/IntroToArduino
#[fit]Arduino <-> Peripheral Communication
- Tons of shields are available. Most include a library to use them.
- There are also tons of libraries for non-shield peripherals.
- Many peripherals use SPI, i2c, RS-232, etc. Makes communication easy.
#[fit]Supporting custom peripherals.
Bit banging:
for(int ledIndex = 0; ledIndex < NUM_LEDS; ledIndex++){
for(int x=7; x>=0; x--){
NRF_GPIO->OUTSET = PIN;
if(ledBar[ledIndex] & (0x01 << x)) {
__ASM ( \
" NOP\n\t" \
" NOP\n\t" \
" NOP\n\t" \
" NOP\n\t" \
" NOP\n\t" \
);
NRF_GPIO->OUTCLR = PIN;
}else{
NRF_GPIO->OUTCLR = PIN;
__ASM ( \
" NOP\n\t" \
" NOP\n\t" \
" NOP\n\t" \
);
}
}
}
Communicating with iOS
Options:
#Bluetooth 4.0
Often the best way to communicate with iOS devices.
Multiple options:
- Several Bluetooth 4.0 shields exist
- RFduino
- Bluno
- LightBlue Bean - Program it from your phone!
- And more
#[fit]Demo Time
.
#Beyond Prototyping
Arduino is open source hardware. Use that to your advantage. Often, your Arduino prototype will be largely reusable for your final design.
Devices like the RFduino, Light Blue Bean, etc., are available as bare parts in quantity at reasonable prices.
Beyond that, the move to "real" microcontrollers is not as hard as you think.
#Resources
- https://github.com/armadsen/IntroToArduino
- Arduino Homepage: http://arduino.cc
- Dash docset
- Adafruit, Sparkfun, RadioShack for hardware including shields.