Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Saturday Morning BreakfastSerial: Hacking Ardui...
Search
PyCon Canada
August 14, 2013
Education
200
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Saturday Morning BreakfastSerial: Hacking Arduinos in Python (Swift)
PyCon Canada
August 14, 2013
Transcript
38 slides
BREAKFAST SATURDAY MORNING SERIAL by @SwiftAlphaOne
Note: I’m not Ryan Gosling @SwiftAlphaOne
ARDUINO! Let’s talk about
Why are developers cuckoo for arduino?
SIMPLE API
Giraffe Add Tiger Head Tigeraffe Arduino is Open Source
None
EVERYWHERE Now Available
LOTS OF EXAMPLES
GR-R-REAT! Arduino is
1 2 3 4 USB Serial Port Ground & Power
Digital Pins Analog Pins ARDUINO 101
HELLO WORLD “ ”
Download the IDE http://arduino.cc/en/main/software
Wire up a LED
Blink 1: Arduino int led = 13; void setup() {
pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); }
Prototyping in C, Hey kids! is totally fun and easy.
“ ” - The Trix Rabbit
Friends don’t let Friends PROGRAM IN C.
THE INTERNETS? How do I talk to “ ”
#include <Ethernet.h> #include <SPI.h> EthernetClient client; String data = '{"foo":"bar"}';
void setup() { Ethernet.begin({0x90,0xA2,0xDA,0x00,0x55,0x8D}); } void loop() { if (client.connect("www.someapi.com",80)) { client.println("POST /api/v1/endpoints HTTP/1.1"); client.println("Host: www.someapi.com"); client.println("Content-Type: application/json"); client.print("Content-Length: "); client.println(data.length()); client.println(); client.print(data); client.println(); } }
#include <Ethernet.h> #include <SPI.h> EthernetClient client; String data = '{"foo":"bar"}';
void setup() { Ethernet.begin({0x90,0xA2,0xDA,0x00,0x55,0x8D}); } void loop() { if (client.connect("www.someapi.com",80)) { client.println("POST /api/v1/endpoints HTTP/1.1"); client.println("Host: www.someapi.com"); client.println("Content-Type: application/json"); client.print("Content-Length: "); client.println(data.length()); client.println(); client.print(data); client.println(); } } LOL
HORSEPOWER Limited .
A BETTER WAY! There must be
Feature Wishlist Language Agnostic Cross Platform Talks to the Internets
Complex Processing
FIRMATA http://firmata.org Follow your nose!
from pyfirmata import Arduino from time import sleep board =
Arduino('/dev/cu.usbmodem1411') ledPin = board.board.digital[13] while 1: ledPin.write(1) sleep(1) ledPin.write(0) sleep(1) Blink 2: pyFirmata
Johnny-Five ? Javascript Ruby Python
Cookies for breakfast!? Python ^
BREAKFASTSERIAL http://github.com/theycallmeswift/BreakfastSerial
$ pip install BreakfastSerial
from BreakfastSerial import Arduino, Led board = Arduino() led =
Led(board, 13) led.blink(1000) Blink 3: BreakfastSerial
None
Feature Wishlist Language Agnostic Cross Platform Talks to the Internets
Complex Processing
Language Agnostic Cross Platform Talks to the
Internets Complex Processing Feature Wishlist
Buttons, LEDs, & Sensors. “ ” Servos & buzzers too.
Lots of new components, added by devs like you!
SRSLY THO, I ACCEPT PULLS http://github.com/theycallmeswift/BreakfastSerial
M OAR!
ARDUINO.IO No, really. It’s coming. Go sign up. http://arduino.io
THANK YOU @SwiftAlphaOne theycallmeswift.com
More Decks by PyCon Canada
See All by PyCon Canada
Job Security (in Python) (Christopher Neugebauer)
pyconca
2
580
Sad Panda Needs a Hug (Nina Zakharenko)
pyconca
0
530
Shopify Checkout (Chris Saunders)
pyconca
0
280
Skyfield and 15 Years of Bad APIs (Brandon Rhodes)
pyconca
0
490
Planting Open Source Seeds (Kenneth Reitz)
pyconca
0
190
Why Open Source Works (Alex Gaynor)
pyconca
0
280
How to learn Python in 5 Minutes (Daniel Moniz)
pyconca
0
1.1k
Sunday Morning Keynote (Karen Brennan)
pyconca
0
380
Saturday Morning Keynote (Jacob Kaplan-Moss)
pyconca
2
150
Other Decks in Education
See All in Education
Biological Source, Chemical Constituents And Therapeutic Efficacy
pawan_pharm
0
140
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
3
3.6k
1111
cbtlibrary
0
150
クオリティエンジニアリング ーゲームの品質を支えるエンジニアー
segadevtech
1
1.1k
HTTP APIs in Python
madhuri28
0
130
Biologicals & Herbals, and Food & Nutraceuticals
drpoonamkc
0
110
Session 4 - Teknik Lobby dan Negosiasi
adeputra13
0
800
CSS3 and Responsive Web Design - Lecture 5 - Web Technologies (1019888BNR)
signer
PRO
1
3.5k
検定資格の価値 ~実はすごいよQC検定~
bunnchinn3
0
290
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 NISO Training Series, Session Two: Fair Use and the Public Domain"
baltimoreniso
0
170
Session 6 - Mass Communication
adeputra13
0
260
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 6
hiola
0
9.3k
Featured
See All Featured
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
600
The Cult of Friendly URLs
andyhume
79
7.1k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
SEO for Brand Visibility & Recognition
aleyda
0
4.9k
Code Review Best Practice
trishagee
74
20k
Balancing Empowerment & Direction
lara
6
1.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
A Tale of Four Properties
chriscoyier
163
24k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
A better future with KSS
kneath
240
18k