Development Environments Raspberry Pi Saman Amighi 042014 Raspberry
Development Environments Raspberry Pi ® Saman Amighi 04/2014 ® Raspberry Pi Foundation
Raspberry Pi Created by the Raspberry Pi Foundation Built to be an educational tool Credit Card size computer Linux Based Can be powered up with existing power supplies or batteries
Raspberry Pi Ports Key Parts • USB (1/2) • Keyboard • Mouse • Power (micro. USB) • SD Card • HDMI or TV Video • Network/LAN (100) • Other • GPIO pins • Audio Jack • Status LEDs
Raspberry Pi General Purpose Input Output (GPIO) Key Pins 1 – 3. 3 V 2– 5 V 6 – Ground 7 – GPIO 4* 13 – GPIO 21/27
Raspberry Pi First steps Purchase Raspberry Pi Purchase Components Create SD card Boot up initial Image Login
Next Steps Decide on a project Which project do you want to work on? Electronics – 3 hours - $50 Media Center – 3 -5 hours - $30 Linux box with 100% up time – 1 hours - $0 Printer Server (CUPS) – 1 hours - $0 NAS – 3 hours - $100 Laptop (Atrix Lapdock) – 3 hours - $100
Development Enviroment Decide on a Development Enviroment Where? Work on the Raspberry PI Work on your own Computer How? Which editor to use Locally - VI, EMACS, NANO, etc. Remotely - Windows- Notepad, Mac – Text. Wrangler Required native SFTP and backups
Development Environment (cont’d) Decide on a Development Environment (cont’d) Programming Language C/C++ Python Shell Scripts (+Cron) PHP Etc Native Compilers/Processors GCC++ Python PHP Non-Native
Language Examples C/C++ - Compiled Language case sensitive Difficult to work with strings Very specific on variable types Code char my. String[10]; int i. My. Int; strcpy(my. String, ”Hello”); Int my. Function(int ilocal. Integer) { return ilocal. Integer+1; }
C++ Example bool MPU 9150: : begin(mpu 9150_gyr o_range_t g_rng, mpu 9150_accel_ran ge_t a_rng, byte addr) {
Language Examples Python – Interpretive Language Case sensitive Indentation heavy (instead of using {} or terminators) Loose on type definitions ( 1 = “ 1”) Can be run interactively python func 1. py OR python and use command line Print “Hello World” a=5 mult(a)
Python Example Command Line $ python -c 'print "Hello World!"’ Code import re for test_string in ['555 -1212', 'ILL-EGAL']: if re. match(r'^d{3}-d{4}$', test_string): print test_string, 'is a valid US local phone number' else: print test_string, 'rejected'
- Slides: 12