The Pi Book - 06-2016
Book information
Description
Introduction – The PI Book What is a Raspberry Pi Pi Product Models Powering the Pi Power Consumption Pi Operating Systems Pi Zero Pi 3 Box housings for the Pi Heat sinks Powering off the Pi Architecture The ARM CPU Broadcom System On a Chip Video subsystem Storage subsystem Installation Installing Raspbian Installation tools apt-cache apt-file apt-get apt dpkg synaptic – GUI package management Updating The Raspbian Environment The shell The file system Mounted file systems File permissions Visualizing the File system Editors Processes Kernel mode vs User mode Root privileges and running applications Security and userids System applications Writing your own units The systemd-ui Kernel modules The Device Tree CPU - /proc/cpuinfo Memory - /proc/meminfo System parameters Clock frequencies Internal temperature Memory Hardware interfacing Pin numbering Bread-boarding Power GPIO GPIO theory GPIO on the Pi SPI SPI theory SPI on the Pi SPI in Python I2C I2C theory I2C on the Pi PWM PWM theory PWM on the Pi UART (Serial) Interface UART theory UART on the Pi Using a USB to UART as additional UART Programming against UART Analog input USB Audio Ethernet Video output Camera WiringPi WiringPi setup WiringPi GPIO WiringPi SPI WiringPi I2C WiringPi PWM The pigpio library Memory mapped I/O Using sysfs to access GPIO Using an Arduino as a peripheral controller Physical Arduino boards GPIO mapping between the Pi and Arduino I2C mapping between the Pi and Arduino Integrating the ATMEGA 328P with your Pi Using Firmata with the Arduino Programming in general ELF structure Libraries of code Static vs Dynamic libraries Building shared libraries General development tools ar ldd nm objdump ranlib readelf C Programming C Programming theory C tools for Pi Simple compilation Editing sources via Eclipse Editing sources on the Pi Cross compilation Makefiles Debugging C Debugging on a remote Pi C++ Programming Calling functions Install the ARM compiler tool-chain Java Programming Java Development Environment for Pi Using Eclipse for Java Pi development Pi4J Project Pi4J Installation Writing Pi4J applications Pre-built Pi4J classes The Device I/O API UI programming in Java JavaFX Calling C from Java JavaScript Programming Node.js NPM Writing an NPM module GPIO from Node.js Using npm wiring-pi Parsing arguments Debugging Node.js File I/O in Node.js Nashorn JavaScript bit-twiddling Python Programming Node-RED Node-RED Pi local installation Node-RED Windows installation Node-RED – writing flows Advanced Node-RED configuration Including additional npm packages Writing Custom Node-RED nodes Node definition properties Installing Custom Node-RED modules during development Sharing Node-RED flows Shell Programming Shell language constructs Shell loops Arduino programming for the Pi Overview of the Arduino IDE Installing the Arduino IDE on Windows Installing the Arduino IDE on Linux Installing the Arduino IDE board configuration for the Pi Configuring the Pi Selecting the Pi as the target for development Developing with an NFS export from or to the Pi Debugging a sketch Differences from a hardware Arduino Redirecting Serial output to the Console Importing a 3rd party library Running the Arduino IDE on the Pi Raspbian Environment Programming Audio output from a your application Multi threading Open file descriptors Networking Networking Devices Ethernet Setting up a static Ethernet IP Address Using Windows Internet Connection Sharing WiFi WiFi USB devices Scanning WiFi networks Setting up WiFi connections Setting up the Pi as an Access Point Captive portal for PI hot spot Wireless Supplicant Programming to WiFi Using a Windows PC as a WiFi access point / hotspot DHCP Remote login Domain Name Service DNS Service Discovery and Multicast DNS Accessing your Pi from the Internet Routing Web browsers and servers Pi as a Web Server Pi as a Web Browser Sharing Windows files Network File System (NFS) Cloud Systems Thingspeak.com Sockets API programming Finding an IP address from a hostname Creating a socket client Creating a socket server Sending data through a socket Receiving data through a socket Closing a socket UDP programming JavaScript socket.io Sending an email MQTT MQTT Protocol Mosquitto MQTT Building mosquitto from source Installing on Windows Writing MQTT clients Eclipse paho C – Mosquitto client library Node.js JavaScript – MQTT Browser JavaScript – MQTT Interacting with Mobile devices Blynk MIT App Inventor 2 Bluetooth Bluetooth specification Service Discovery Protocol Bluetooth C Programming hci_get_route hci_open_dev hci_inquiry hci_read_remote_name str2ba ba2str Bluetooth Audio Bluetooth RFCOMM Bluetooth tools l2ping rfcomm bluetoothctl hciconfig hcitool If This then That ... Audio USB attachable audio Linux ALSA – Advanced Linux Sound Architecture Pulse Code Modulation ALSA programming ALSA device enumeration ALSA audio input / capture ALSA from JavaScript Frequency Spectrum Analyzer The libsndfile library Speech output X-Windows Using xming on a Windows PC Desktop environments Adding desktop entries Writing native graphics apps VNC – Virtual Network Computing Logging Performance Resource Utilization Memory Utilization Performance Commands top lxtask vmstat Performance characteristics of different programming languages Security Firewalls … on and off Bare Metal Programming Hardware Interfacing Examples Simple GPIO Output change Using the shell Using WiringPi Using Pi4J Using Node.js Using RasPiArduino Using Python Using Node-RED Simple GPIO Input detection Using the shell Using WiringPi Using Pi4J Using Node.js Using Python Using Node-RED Interrupt Driven Input detection Using the shell Using WiringPi Using Pi4J Using Node.js GPIO extenders PCF8574 MCP23017 NeoPixels NeoPixel theory NeoPixels on the Pi NeoPixels through the Arduino DC Electric Motors The H-Bridge Using the TB6612FNG Stepper Motors The 28BYJ-49 Using the A4988 Stepper Motor driver Attaching Stepper motors Servos The Mini/Micro SG90 Using the gpio command for PWM Using WiringPi A PWM Tester PWM Controllers PWM Controller using Node.js PWM Controller using Node-RED GPS The gpsd package GPS from your cell phone The Pi Camera Time lapse capture Video / Webcams Streaming a webcam video Recording a webcam image for a period of time Recording a video Playing video Barcode and QR Code scanning OpenCV – Webcam programming Analog to Digital conversion – ADC0832 Using the shell Using WiringPi Using Pi4J Using Node.js Analog to Digital conversion – MCP3208 Using WiringPi Analog to Digital conversion – ADS1015 Using JavaScript Analog to Digital conversion – Arduino Digital to Analog conversion Joysticks Compass – HMC5883L (aka GY-271) Tilt compensation of the compass Using the shell Using WiringPi Using Pi4J Using Node.js Accelerometer and Gyroscope – MPU-6050 (aka GY-521) The math of Accelerometers Visualizing orientation Using the shell Using WiringPi Using JavaScript Using Arduino libraries Accelerometer and Gyroscope and Compass – MPU-9255 Accelerometer – ADXL335 Accelerometer – ADXL345 Accelerometer – MMA7455 Motion detectors – Passive Infrared Sensor (PIR) Ultrasonics – HC-SR04 Using the shell Using WiringPi Using Pi4J Using Node.js Audio using the ICSH030A Audio using the WTV020SD Audio Module Arduino Library Audio using JQ6500 PAM8403 Audio Amplifier Graphic Equalizer Microphone inputs Buzzers and Piezos FM Radio Temperature and Humidity – DHT22 Using WiringPi Using the Arduino APIs Temperature and pressure – BMP180 Using the Arduino APIs Pressure strips – FSR 402 Ambient light sensor – BH1750FVI Infrared receivers LED 7-Segment displays MAX7219/MAX7221 – Serial interface, 8-digit, led display drivers Using the Arduino APIs Using Python Using JavaScript LCD dot matrix display – HD44780 Using WiringPi Using Java Using JavaScript PCF8574 module LCD display – Nokia 5110 – PCD8544 Using WiringPi Using Pi4J OLED 128x64 – SSD1306 Using the Android API TFT 1.44" Color – ST7735 TFT 1.44" Color – ILI9163C TFT 2.4" 320x240 – TJCTM24024-SPI Frame Buffer TFT driver Touch screen input RFID MFRC522 MFRC522 – Low levels Initialization AntennaOn Using Python Using JavaScript Using Arduino Serial connectors Communications – nRF24L01 Using the Arduino APIs Bluetooth – HC-05/HC-06 Bluetooth – USB Dongle Using a WiiMote Micro SD card readers and writers Real time clocks Opto isolators / Opto couplers CD4051 – Digital switches Radio Control Interactions Software Defined Radio – DVB-T Receiver ADS-B Decoding ATtiny85 integration ATtiny85 – Arduino IDE programming ATtiny – I2C – Slave ATtiny – Debugging ATtiny – USI – Universal Serial Interface Arcade machine Vertical Plotting Line drawing Robotics Locomotion Motors and Torque Robot frame Actobotics commonly used parts The wheeled robot project Robot – Network commands Balancing wheel power Opto-coupler Compass bearing Accelerometer Browser based control program Moving in a pattern – straight line Programming APIs The hexabot project Powering the hexabot Physical characteristics The Hexapod software Windows IoT Connecting the dashboard Opening a shell to the Windows 10 IoT Process management commands Installing Visual Studio Community 2015 Running samples Processing.org Importing Blender graphics Processing and network interfaces P5.js Electronics Drawing circuits and breadboards – Fritzing Drawing Schematics – Digi-Key Scheme-it Using a logic analyzer Building a prototyping environment for the Pi Zero Overcoming trepidation of using Integrated Circuits Logic Level Shifting Transistors as switches Power inputs Current and Voltage meters Migrating code from the Arduino Arduino I2C – Wire class Wire.begin Wire.beginTransmission Wire.write Wire.endTransmission Wire.read Wire.requestFrom Scheduling applications Setting up Linux on Virtual Box on Windows Increasing the disk size for a Linux Virtual Box image Web programming Browser security REST requests JSON processing in C Using postman for testing Writing a REST request using C Writing a REST request using Node.js Writing an App that listens for REST requests Listening for REST requests using Node.js WebSocket A WebSocket browser hosted application Pi as a WebSocket server WebSocket Server for C using libwebsocket WebSocket Server for C using noPoll WebSocket Server in JavaScript Node.js as a Web Server Node.js and Express Express middleware Express routing Express Web Socket support Express as an https server jQuery – JavaScript framework Using jQuery Making REST requests using jQuery Problem Solving Problem solving procedures Take lots of notes Assume nothing Always see what others have done Always ask for help Project stories Music/Audio spectrum decoder The Bubblesteen bubble machine The large bubble machine Ambient sound for art The presenters neck-tie Reference Information Recommended software add-ons Magazines Forums You Tube Chat rooms WiringPi Reference information gpio command gpio clock gpio mode gpio pwm gpio pwmc gpio pwmr gpio pwm-bal gpio pwm-ms gpio read gpio readall gpio wfi gpio write delay delayMicroseconds digitalRead digitalWrite digitalWriteByte micros millis physPinToGpio piBoardRev piHiPri piThreadCreate piLock pinMode piUnlock pullUpDnControl pwmSetClock pwmSetMode pwmSetRange pwmWrite serialClose serialDataAvail serialFlush serialGetchar serialOpen serialPutchar serialPuts serialPrintf setPadDrive shiftIn shiftOut softPwmCreate softPwmWrite softToneCreate softToneWrite wiringPiI2CRead wiringPiI2CReadReg8 wiringPiI2CReadReg16 wiringPiI2CSetup wiringPiI2CWrite wiringPiI2CWriteReg8 wiringPiI2CWriteReg16 wiringPiISR wiringPiSetup wiringPiSetupGpio wiringPiSetupPhys wiringPiSetupSys wiringPiSPIDataRW wiringPiSPISetup wpiPinToGpio wiringPiDev – LCD lcdInit lcdHome lcdClear lcdPosition lcdPutchar lcdPuts lcdPrintf WiringPi Mapping from Arduino Python RPi.GPIO reference Python SPI reference spi.openSPI spi.transfer spi.closeSPI cURL API programming Sample CURL application Adafruit GFX library Interacting directly with the BCM2835 ARM Peripherals Auxiliary Peripherals AUXIRQ – Check interrupts AUX_ENABLES – Enable the modules Mini UART, SPI1 and SPI2 AUX_MUI_IO_REG – Read and write data AUX_MU_IER_REG – Enable interrupts AUX_MU_IRR_REG – Interrupt status AUX_MU_LCR_REG AUX_MU_MCR_REG – Modem control AUX_MU_LSR_REG – Data status AUX_MU_MSR_REG – Modem status AUX_MU_CNTL_REG – Extra controls AUX_MU_STATE_REG – Extra status bits AUX_MU_BAUD_REG – Baudrate counter BCM2835 GPIO Register addresses GPIO function select setting GPIO set high level – GPSET0 and GPSET1 GPIO set low level – GPCLR0 and GPCLR1 GPIO query levels – GPLEV0 and GPLEV1 GPIO event detection – GPEDS0 and GPEDS1 GPIO rising edge detection – GPREN0 and GPREN1 GPIO rising edge detection – GPFEN0 and GPFEN1 GPIO high detection – GPHEN0 and GPHEN1 GPIO low detection – GPLEN0 and GPLEN1 GPIO Pullup/Pulldown – GPPUD BCM2835 UART DR – Data Register RSRECR – Receive status / error clear Register FR – Flag Regiser IBRD – Integer baud rate divisor FBRD – Fractional baud rate divisor LCRH – Line control register CR – Control register IFLS – Interrupt FIFO level select register IMSC – Interrupt mask set / clear register RIS – Raw interrupt status register MIS – Masked interrupt status register ICR – Interrupt clear register BCM2835 PWM CTL – PWM Control Interacting using mmap() Common C language includes Missing data types String functions Math functions Cheat Sheets Wiring Pi Cheat Sheet Pi4J Cheat Sheet Linux cheat commands Compressed/archived files Node-RED Node Reference Input Nodes Inject Catch Status MQTT Input HTTP WebSocket Input TCP Input UDP Input Serial Output Nodes Debug MQTT HTTP Response WebSocket Output TCP Output UDP Output Serial Function Nodes Function Template Delay Trigger Comment Http Request TCP Request Switch Change Range CSV HTML JSON XML RBE Soap Request Social Nodes E-Mail (Input) Twitter (Input) E-Mail (Output) Twitter (Output) Storage Nodes Tail File (Input) File (Output) Analysis Nodes Sentiment Advanced Nodes Watch Feedparse Exec Daemon User Interface UI Button UI Button Row UI Radio Button UI Switch UI Slider UI Numeric UI Text UI Text Input UI Gauge UI Chart UI Toast UI Link UI Template Raspberry PI rpi-gpio (Input) rpi-gpio (Output) rpi-mouse rpi-keyboard ldeborg Reference documents Credits Research Areas
Similar books
Kolban's Book on the ESP32 & ESP8266
2016 · PDF
The Pi Book - 06-2016
EPUB
Kolban's Book on ESP32
2018 · PDF
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF