Professional Documents
Culture Documents
MFA Design & Technology IOT Fall 2015: Ayodamola (Ayo) Okunseinde
MFA Design & Technology IOT Fall 2015: Ayodamola (Ayo) Okunseinde
Intro to Python
History of Python
https://docs.python.org/2/tutorial/introduction.html#
Python is similar in some ways to Perl and Java. Knowing Perl or Java will
help you learn Python, but it's just as easy to pick it up as a language.
Python is great for both shell and web scripting and is making it's way into
every facet of computing from APIs to video and interactivity.
Guido van Rossum first created Python in the late eighties and early
nineties. It is now maintained by a core development team.
Why Python
Python is Efficient : Iterative processes, good with lists, memory management
Python is Fast : Even if interpretive language can add decorators to speed up. Increasing in performance
Python is Broad : Systems automation, testing, gaming, CGI, and web development. Many modules
Python is Easy : Readable syntax, easy for non-programmer types, plays well with other languages
Python is Fun : Broaden your programing base, show off, reason differently
4
-9
49
900
>>> s="hot"
>>> p="dog"
>> print s+p
hotdog
>>> a, b = 0, 5
>>> while b<1000:
print b
[1, 20, 5, 6]
a,b = b, a+b
1.1.2.3.5.8
5.5.10.15.25
sleeping...
print a
a,b=b,a+b
>>> fib(2000)
Script - ip-email.py
Laptop Terminal
Raspberry Pi
$ cd /home/path/toscript
$ touch ip-email.py
$ sudo nano ip-email.py
paste contents of script into terminal
$ sudo python ip-email.py
Python update/GPIO
Install latest python 2.7 and python pip
$ sudo apt-get install python-pip python2.7-dev
Update distribution
$ sudo easy_install -U distribute
Install feedparser
$ sudo pip install feedparser
GPIO
GPIO
http://elinux.org/RPi_Low-level_peripherals#GPIO_Code_examples
GPIO.BOARD
GPIO.BCM
BOARD / BCM
Resistors
Resistors
Debounce
Pullup
Pulldown
Digital in only
ADC
RC analog input
http://www.raspberrypi-spy.co.
uk/2013/10/analogue-sensors-on-the-raspberry-piusing-an-mcp3008/
https://arduinodiy.wordpress.com/2013/10/19/793/
PWM
Fading LED
Servo
Assignment