Raspberry Pi - HW/SW Application Development

Corley S.r.l.
Corley S.r.l.Corley S.r.l.
Raspberry Pi HW/SW 
Application Development 
Make your own shield and control peripheral using RPi 
Walter Dal Mut & Francesco Ficili
Intro to RPi 
● Basically a Microcomputer on a ‘Credit Card sized’ board 
● Based on a Broadcom SoC 
● Many different interfaces: USB, Ethernet, HDMI, SD, TFT 
Display... 
Model B Model B+
...And a Mysterious Thing 
● The RPi GPIO (General 
Purpose IO) Connector 
contains all low-level 
interface of the board. 
● Usually not known by high-level 
software programmers. 
● Well known by embedded 
software developers. 
● It’s the best choice to make 
board functionalities 
expansions.
Interface Options 
● GPIO: the General Purpose Input Output is the most simple interface of the 
board. It can writes or reads the status of a single pin. 
● UART: the Universal Asyncronous Receiver Transmitter is one of the most 
used serial standard in data communication. It’s the TTL level version of 
the old PC RS232 interface (tty under Linux). It is a full-duplex point-to-point 
standard. 
● I2C: the Inter Integrated Circuit (aka I square C) is a communication 
standard developed by Philips during ‘80. It’s a address oriented, half-duplex, 
master-slave multidrop standard. It also support a multi-master 
variant. 
● SPI: the Serial Peripheral Interface is a communication standard 
developed by Motorola. It is a master-slave multidrop full-duplex standard.
The ‘Shield’ Concept 
● Shield Definition (from Arduino Website): “Shields are boards that can be 
plugged on top of the Arduino PCB extending its capabilities” 
● So a Shiled is, basically, an application-oriented expansion board that is 
managed by the main board through one of its interfaces. 
Example of RPi Shield 
(GSM/GPRS Shield) Arduino ZigBee Shiled RPi to Arduino Shields 
Adapter
Build a Custom Shield 
● Many different type of shields available on the market. 
● Sometimes the range of available shields could not fit a particular 
application or you may have the idea of build your shield by your own. 
● To build a custom shield you need: 
○ An electronic CAD for design, 
○ A PCB maker, 
○ Shield components, 
○ Assembly operations. 
● Many PCB maker provide assembly 
service.
KiCAD EDAS 
● Many different type of EDAS (Electronic Design Automation Suite) 
available nowadays: ORCAD, Mentor, Allegro, Altium Designer… 
● Expensive Licensing, too complex for the task, too much tool inside the 
suite… Not suitable for RPi shields development. 
● Some free open source EDAS developed through years by electronic 
entusiasts are now reaching a good maturity level. 
● KiCAD is one of this tools!!!
Why KiCAD? 
● Completely free and open source, 
○ http://www.kicad-pcb.org/ 
● Cross-platform (Linux, MacOS and Win), 
● Simple to use (getting started is only 27 pages long), 
● Very large community of users that shares component libraries, 
● Examples: 
○ http://smisioto.no-ip.org/elettronica/kicad/kicad.htm (useful lid for 
hobbysts) 
○ http://kicad.rohrbacher.net/quicklib.php (component generator) 
○ http://www.kicadlib.org/ (libraries collection) 
○ … and many others
Suite Description 
● It comprises a schematic 
editor, layout editor, gerber 
visualization tools and provide 
a simple interface for output 
files generation, 
Kicad Project Manager
Kicad Development Process
Schematic Editor
From Schematic to Layout
Layout Editor 
Navigation Shield Layout
Examples 
● Navigation Shield 
○ GPS Unit (over UART link) 
○ IMU Unit (over I2C link) 
○ GP LEDs 
○ Possible application: rovers or drone 
navigation control 
● Smart I/O Shield 
○ 5 Analog Inputs, 
○ 8 Digital I/O (2 PWM), 
○ PIC18F2550 with I2C interface 
○ Possible application: I/O expander for 
RPI (acquisition, control…).
Build your prototype 
● PCB (need gerber files): 
○ Md srl: http://www.mdsrl.it/ (very professional service) 
○ PCBProto: http://www.pcb-proto.com/ (very large pool) 
○ JackAltac: http://www.jackaltac.com/ (cheaper one) 
● Components (need Bill of Material): 
○ Farnell, RS, Futura... 
● Assembly (in case of pick-and-place need module position files) 
○ Md srl is now providing an assembly service (quite expensive for 
small numbers) 
○ ...otherwise buy a solder station
Stairway to heaven
GPIO - General Purpose In/Out 
● GPIO strip provides different communication 
layers (board to board or on single board) 
○ Generic In/Out pins (different libraries) 
○ UART - Serial Communication 
○ I2C - InterIntegrated Circuit 
○ SPI - Serial Peripheral Interface
GPIO - Support Libraries 
● Not included by default 
○ http://www.airspayce.com/mikem/bcm2835/bcm2835-1.37.tar.gz 
./configure 
make 
sudo make check 
sudo make install
int main(void) 
{ 
if (!bcm2835_init()) { exit(1); } 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_11, BCM2835_GPIO_FSEL_OUTP); 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_13, BCM2835_GPIO_FSEL_OUTP); 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_15, BCM2835_GPIO_FSEL_OUTP); 
bcm2835_gpio_write(RPI_V2_GPIO_P1_11, HIGH); 
bcm2835_gpio_write(RPI_V2_GPIO_P1_13, HIGH); 
bcm2835_gpio_write(RPI_V2_GPIO_P1_15, HIGH); 
return 0; 
}
int main(void) 
{ 
if (!bcm2835_init()) { exit(1); } 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_11, BCM2835_GPIO_FSEL_OUTP); 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_13, BCM2835_GPIO_FSEL_OUTP); 
bcm2835_gpio_fsel(RPI_V2_GPIO_P1_15, BCM2835_GPIO_FSEL_OUTP); 
uint8_t c = 0; 
while (1) { 
bcm2835_gpio_write(RPI_V2_GPIO_P1_11, c); 
bcm2835_gpio_write(RPI_V2_GPIO_P1_13, c); 
bcm2835_gpio_write(RPI_V2_GPIO_P1_15, c); 
c = !c; 
sleep(1); 
} 
return 0; 
}
GPIO - BCM2835 - board versions 
● Model A 
○ RPI_GPIO_P1_03 
○ RPI_GPIO_P1_05 
○ RPI_GPIO_P1_07 
● Model B 
○ RPI_V2_GPIO_P1_03 
○ RPI_V2_GPIO_P1_05 
○ RPI_V2_GPIO_P1_07 
● Model B+ 
RPI_BPLUS_GPIO_J8_03 
RPI_BPLUS_GPIO_J8_05 
RPI_BPLUS_GPIO_J8_07 
http://www.airspayce.com/mikem/bcm2835/bcm2835_8h_source.html
GPIO in action 
Low-cost ultrasonic 
sensors turn on/off a 
pin in order to convert 
real distances 
HC-SR04 
https://github.com/wdalmut/libultrasonic
UART for Raspberry Pi 
● 2 functional modes 
○ TTY for terminal connections (serial console) 
○ For other micros and components 
● Peripheral mode need few configurations 
○ Appears as /dev/ttyAMA0 
○ http://elinux. 
org/RPi_Serial_Connection#Connection_to_a_micro 
controller_or_other_peripheral
Connect your Raspberry PI
Initialize your serial module 
void serial_init(void) 
{ 
uart0_filestream = open(“/dev/ttyAMA0”, O_RDWR | O_NOCTTY | 
O_NDELAY); 
if (uart0_filestream == -1) 
{ 
//TODO error handling... 
} 
}
Config your UART registry 
void serial_config(void) 
{ 
struct termios options; 
tcgetattr(uart0_filestream, &options); 
options.c_cflag = B9600 | CS8 | CLOCAL | CREAD; 
options.c_iflag = IGNPAR; 
options.c_oflag = 0; 
options.c_lflag = 0; 
tcflush(uart0_filestream, TCIFLUSH); 
tcsetattr(uart0_filestream, TCSANOW, &options); 
}
Send data to your peripheral 
int count = write(uart0_filestream, data, dataLen); 
Pay attention with strings (char vectors) because dataLen doesn’t 
include the termination byte (“0”)
Read data from your peripheral 
int rx_length = read(uart0_filestream, (void*)(&c), len);
A navigation shield for Raspberry Pi 
Adafruit Ultimate GPS 
Breakout v3 
UART GPS module 
https://github.com/wdalmut/libgps
I2C - Inter-Integrated Circuit 
● Multiple components uses I2C in order to 
communicate 
● Raspberry PI supports also this peripherals 
as a master node 
● On raspberry the I2C is disabled by default, 
you have to enable it! 
○ Enable it in your: /etc/modprobe.d/raspi-blacklist. 
conf
How to connect it?
I2C - Initialize it 
void mma7660fc_init(void) 
{ 
i2cdev = open(“/dev/i2c-1”, O_RDWR); 
if (i2cdev == -1) 
{ 
//TODO handle errors 
} 
}
I2C - Write and control your slaves! 
void mma7660fc_on(void) 
{ 
uint8_t buffer[2]; 
buffer[0] = MMA7660_MODE; 
buffer[1] = MMA7660_ACTIVE; 
ioctl(i2cdev, I2C_SLAVE, MMA7660_ADDR); 
write(i2cdev, buffer, 2); 
}
Read from your slaves 
void mma7660fc_get(accel_t *data) 
{ 
uint8_t buffer[11]; 
ioctl(i2cdev, I2C_SLAVE, MMA7660_ADDR); 
read(i2cdev, buffer, 3); //only x,y,z 
data->x = mma7660fc_convert(buffer[0]); 
data->y = mma7660fc_convert(buffer[1]); 
data->z = mma7660fc_convert(buffer[2]); 
}
i2c in action 
MMA7660 
● 3-axis accelerometer 
● Tilt detection 
● Movement detection 
https://github.com/wdalmut/libimu
Higher level with Golang 
package gps 
import( 
// #cgo LDFLAGS: -lgps -lm 
// #include <gps.h> 
"C" 
) 
func GpsLocation() (float64, float64) { 
var data C.loc_t 
var lat, lon float64 
C.gps_location(&data) 
lat = float64(data.latitude) 
lon = float64(data.longitude) 
return lat, lon 
}
Any question? 
Thanks for listening
1 de 37

Recomendados

Sensors, actuators and the Raspberry PI using Python por
Sensors, actuators and the Raspberry PI using PythonSensors, actuators and the Raspberry PI using Python
Sensors, actuators and the Raspberry PI using PythonDerek Kiong
2.8K visualizações25 slides
Exploring Raspberry Pi por
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
15.5K visualizações53 slides
Python in raspberry pi por
Python in raspberry piPython in raspberry pi
Python in raspberry piSudar Muthu
8K visualizações25 slides
Raspberry Pi Using Python por
Raspberry Pi Using PythonRaspberry Pi Using Python
Raspberry Pi Using PythonSeggy Segaran
9.4K visualizações13 slides
Pi Is For Python por
Pi Is For PythonPi Is For Python
Pi Is For PythonBrad Fortner
1.5K visualizações69 slides
Raspberry Pi and Amateur Radio por
Raspberry Pi and Amateur RadioRaspberry Pi and Amateur Radio
Raspberry Pi and Amateur RadioKevin Hooke
16.1K visualizações31 slides

Mais conteúdo relacionado

Mais procurados

NodeMCU ESP8266 workshop 1 por
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
34.3K visualizações35 slides
Making wearables with NodeMCU - FOSDEM 2017 por
Making wearables with NodeMCU - FOSDEM 2017Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017Etiene Dalcol
977 visualizações33 slides
Raspberry Pi and Amateur Radio - 2020 update por
Raspberry Pi and Amateur Radio - 2020 updateRaspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 updateKevin Hooke
164 visualizações35 slides
Introduction To Raspberry Pi with Simple GPIO pin Control por
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlPradip Bhandari
3K visualizações40 slides
Republic of IoT - Hackathon Hardware Kits Hands-on Labs por
Republic of IoT - Hackathon Hardware Kits Hands-on LabsRepublic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on LabsAlwin Arrasyid
163 visualizações32 slides
Programando o ESP8266 com Python por
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com PythonRelsi Maron
2.8K visualizações42 slides

Mais procurados(19)

NodeMCU ESP8266 workshop 1 por Andy Gelme
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
Andy Gelme34.3K visualizações
Making wearables with NodeMCU - FOSDEM 2017 por Etiene Dalcol
Making wearables with NodeMCU - FOSDEM 2017Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017
Etiene Dalcol977 visualizações
Raspberry Pi and Amateur Radio - 2020 update por Kevin Hooke
Raspberry Pi and Amateur Radio - 2020 updateRaspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 update
Kevin Hooke164 visualizações
Introduction To Raspberry Pi with Simple GPIO pin Control por Pradip Bhandari
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin Control
Pradip Bhandari3K visualizações
Republic of IoT - Hackathon Hardware Kits Hands-on Labs por Alwin Arrasyid
Republic of IoT - Hackathon Hardware Kits Hands-on LabsRepublic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
Alwin Arrasyid163 visualizações
Programando o ESP8266 com Python por Relsi Maron
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com Python
Relsi Maron2.8K visualizações
Innovation with pcDuino por Jingfeng Liu
Innovation with pcDuinoInnovation with pcDuino
Innovation with pcDuino
Jingfeng Liu2.1K visualizações
Micro Python で組み込み Python por Hirotaka Kawata
Micro Python で組み込み PythonMicro Python で組み込み Python
Micro Python で組み込み Python
Hirotaka Kawata21.3K visualizações
Esp8266 - Intro for dummies por Pavlos Isaris
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummies
Pavlos Isaris1.5K visualizações
pcDuino Presentation at SparkFun por Jingfeng Liu
pcDuino Presentation at SparkFunpcDuino Presentation at SparkFun
pcDuino Presentation at SparkFun
Jingfeng Liu2.4K visualizações
pcDuino tech talk at Carnegie Mellon University 10/14/2014 por Jingfeng Liu
pcDuino tech talk at Carnegie Mellon University 10/14/2014pcDuino tech talk at Carnegie Mellon University 10/14/2014
pcDuino tech talk at Carnegie Mellon University 10/14/2014
Jingfeng Liu1.8K visualizações
Espresso Lite v2 - ESP8266 Overview por The World Bank
Espresso Lite v2 - ESP8266 OverviewEspresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 Overview
The World Bank393 visualizações
Wi-Fi Modem For the Commodore 64 por Leif Bloomquist
Wi-Fi Modem For the Commodore 64Wi-Fi Modem For the Commodore 64
Wi-Fi Modem For the Commodore 64
Leif Bloomquist4K visualizações
Introduction to ESP32 Programming [Road to RIoT 2017] por Alwin Arrasyid
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]
Alwin Arrasyid3.9K visualizações
Scratch pcduino por Jingfeng Liu
Scratch pcduinoScratch pcduino
Scratch pcduino
Jingfeng Liu1.5K visualizações
lesson2 - Nodemcu course - NodeMCU dev Board por Elaf A.Saeed
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
Elaf A.Saeed216 visualizações
Meng por Fernando Amaral
MengMeng
Meng
Fernando Amaral164 visualizações
IoT Hands-On-Lab, KINGS, 2019 por Jong-Hyun Kim
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
Jong-Hyun Kim570 visualizações
Raspberry Pi with Java por koji lin
Raspberry Pi with JavaRaspberry Pi with Java
Raspberry Pi with Java
koji lin3.5K visualizações

Destaque

Raspberry pi por
Raspberry pi Raspberry pi
Raspberry pi Anija Nair
124.2K visualizações29 slides
Publiek16. Faalverhalen por
Publiek16. FaalverhalenPubliek16. Faalverhalen
Publiek16. FaalverhalenPubliek Centraal
316 visualizações10 slides
Hoe structureel meer succes boeken als onderneming por
Hoe structureel meer succes boeken als ondernemingHoe structureel meer succes boeken als onderneming
Hoe structureel meer succes boeken als ondernemingParticipium
1.5K visualizações25 slides
De Ruzie-oplosser por
De Ruzie-oplosserDe Ruzie-oplosser
De Ruzie-oplosserWannes Devloo
506 visualizações19 slides
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA... por
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...CLICKNL
563 visualizações79 slides
NLLGG Raspberry Pi Themadag 23-11-2013 por
NLLGG Raspberry Pi Themadag 23-11-2013NLLGG Raspberry Pi Themadag 23-11-2013
NLLGG Raspberry Pi Themadag 23-11-2013Marcel Hergaarden
1.7K visualizações35 slides

Destaque(20)

Raspberry pi por Anija Nair
Raspberry pi Raspberry pi
Raspberry pi
Anija Nair124.2K visualizações
Publiek16. Faalverhalen por Publiek Centraal
Publiek16. FaalverhalenPubliek16. Faalverhalen
Publiek16. Faalverhalen
Publiek Centraal 316 visualizações
Hoe structureel meer succes boeken als onderneming por Participium
Hoe structureel meer succes boeken als ondernemingHoe structureel meer succes boeken als onderneming
Hoe structureel meer succes boeken als onderneming
Participium1.5K visualizações
De Ruzie-oplosser por Wannes Devloo
De Ruzie-oplosserDe Ruzie-oplosser
De Ruzie-oplosser
Wannes Devloo506 visualizações
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA... por CLICKNL
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...
Ruben Verborgh - Creëren, aanbieden en gebruiken van Connected Data (CC BY-SA...
CLICKNL 563 visualizações
NLLGG Raspberry Pi Themadag 23-11-2013 por Marcel Hergaarden
NLLGG Raspberry Pi Themadag 23-11-2013NLLGG Raspberry Pi Themadag 23-11-2013
NLLGG Raspberry Pi Themadag 23-11-2013
Marcel Hergaarden1.7K visualizações
Innovatieworkshop uitgebreide versie por Jos van de Werken
Innovatieworkshop uitgebreide versieInnovatieworkshop uitgebreide versie
Innovatieworkshop uitgebreide versie
Jos van de Werken1.1K visualizações
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application por Corley S.r.l.
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.325 visualizações
Social Media Monitor 6 por Social Embassy
Social Media Monitor 6Social Media Monitor 6
Social Media Monitor 6
Social Embassy33.7K visualizações
Dock-to-bed strategie voor logistiek 4.0 por Jeremy De Sy
Dock-to-bed strategie voor logistiek 4.0Dock-to-bed strategie voor logistiek 4.0
Dock-to-bed strategie voor logistiek 4.0
Jeremy De Sy523 visualizações
Social Media Monitor 7 por Social Embassy
Social Media Monitor 7Social Media Monitor 7
Social Media Monitor 7
Social Embassy23.8K visualizações
Raspberry pi based project abstracts por Softroniics india
Raspberry pi based project abstractsRaspberry pi based project abstracts
Raspberry pi based project abstracts
Softroniics india4.9K visualizações
Prototyping for Interaction Design por Philip van Allen
Prototyping for Interaction DesignPrototyping for Interaction Design
Prototyping for Interaction Design
Philip van Allen12.9K visualizações
Low Cost HD Surveillance Camera using Raspberry PI por Varun A M
Low Cost HD Surveillance Camera using Raspberry PILow Cost HD Surveillance Camera using Raspberry PI
Low Cost HD Surveillance Camera using Raspberry PI
Varun A M8.7K visualizações
Prototype model and process por Danish Musthafa
Prototype model  and processPrototype model  and process
Prototype model and process
Danish Musthafa7.9K visualizações
Are you ready for great business in Industry 4.0? por Participium
Are you ready for great business in Industry 4.0?Are you ready for great business in Industry 4.0?
Are you ready for great business in Industry 4.0?
Participium481 visualizações
Prototype model por sadhana8
Prototype modelPrototype model
Prototype model
sadhana833.4K visualizações
Smart Wireless Surveillance Monitoring using RASPBERRY PI por Krishna Kumar
Smart Wireless Surveillance Monitoring using RASPBERRY PISmart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PI
Krishna Kumar58.5K visualizações
Prototype model por shuisharma
Prototype modelPrototype model
Prototype model
shuisharma88.3K visualizações

Similar a Raspberry Pi - HW/SW Application Development

Getting started with Intel IoT Developer Kit por
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitSulamita Garcia
17.8K visualizações67 slides
arduinoedit.pptx por
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptxrajalakshmi769433
3 visualizações51 slides
Introduction to Internet of Things Hardware por
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things HardwareDaniel Eichhorn
5.4K visualizações36 slides
I made some more expansion board for M5Stack por
I made some more expansion  board for M5StackI made some more expansion  board for M5Stack
I made some more expansion board for M5StackMasawo Yamazaki
949 visualizações22 slides
Arduino por
ArduinoArduino
ArduinoJerin John
5K visualizações30 slides
Johnny-Five por
Johnny-FiveJohnny-Five
Johnny-FiveHenri Cavalcante
379 visualizações16 slides

Similar a Raspberry Pi - HW/SW Application Development(20)

Getting started with Intel IoT Developer Kit por Sulamita Garcia
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
Sulamita Garcia17.8K visualizações
Introduction to Internet of Things Hardware por Daniel Eichhorn
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things Hardware
Daniel Eichhorn5.4K visualizações
I made some more expansion board for M5Stack por Masawo Yamazaki
I made some more expansion  board for M5StackI made some more expansion  board for M5Stack
I made some more expansion board for M5Stack
Masawo Yamazaki949 visualizações
Arduino por Jerin John
ArduinoArduino
Arduino
Jerin John5K visualizações
Johnny-Five por Henri Cavalcante
Johnny-FiveJohnny-Five
Johnny-Five
Henri Cavalcante379 visualizações
Tac Presentation October 72014- Raspberry PI por Cliff Samuels Jr.
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
Cliff Samuels Jr.1.1K visualizações
Raspberry pi technical documentation por GR Techno Solutions
Raspberry pi technical documentationRaspberry pi technical documentation
Raspberry pi technical documentation
GR Techno Solutions1.1K visualizações
Linux+sensor+device-tree+shell=IoT ! por Dobrica Pavlinušić
Linux+sensor+device-tree+shell=IoT !Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !
Dobrica Pavlinušić161 visualizações
Hardware hacking por Tavish Naruka
Hardware hackingHardware hacking
Hardware hacking
Tavish Naruka3.2K visualizações
FPGA Board (Xilinx Arty A7 -35 T) User Guide.pdf por ssuser6a66ac2
FPGA Board (Xilinx Arty A7 -35 T) User Guide.pdfFPGA Board (Xilinx Arty A7 -35 T) User Guide.pdf
FPGA Board (Xilinx Arty A7 -35 T) User Guide.pdf
ssuser6a66ac29 visualizações
Python-in-Embedded-systems.pptx por TuynLCh
Python-in-Embedded-systems.pptxPython-in-Embedded-systems.pptx
Python-in-Embedded-systems.pptx
TuynLCh4 visualizações
4 Introduction to Arduino.pdf por RynefelElopre2
4 Introduction to Arduino.pdf4 Introduction to Arduino.pdf
4 Introduction to Arduino.pdf
RynefelElopre247 visualizações
Raspberry Pi GPIO Tutorial - Make Your Own Game Console por RICELEEIO
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRaspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
RICELEEIO149 visualizações
Ins and Outs of GPIO Programming por ICS
Ins and Outs of GPIO ProgrammingIns and Outs of GPIO Programming
Ins and Outs of GPIO Programming
ICS1.4K visualizações
Attendance system using MYSQL with Raspberry pi and RFID-RC522 por Sanjay Kumar
Attendance system using MYSQL with Raspberry pi and RFID-RC522Attendance system using MYSQL with Raspberry pi and RFID-RC522
Attendance system using MYSQL with Raspberry pi and RFID-RC522
Sanjay Kumar3.1K visualizações
arduino.pdf por Gurumurthy B R
arduino.pdfarduino.pdf
arduino.pdf
Gurumurthy B R4 visualizações
Kernel Recipes 2018 - New GPIO interface for linux user space - Bartosz Golas... por Anne Nicolas
Kernel Recipes 2018 - New GPIO interface for linux user space - Bartosz Golas...Kernel Recipes 2018 - New GPIO interface for linux user space - Bartosz Golas...
Kernel Recipes 2018 - New GPIO interface for linux user space - Bartosz Golas...
Anne Nicolas2.4K visualizações
Lab Handson: Power your Creations with Intel Edison! por Codemotion
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
Codemotion2K visualizações

Mais de Corley S.r.l.

Aws rekognition - riconoscimento facciale por
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento faccialeCorley S.r.l.
313 visualizações18 slides
AWSome day 2018 - scalability and cost optimization with container services por
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesCorley S.r.l.
273 visualizações34 slides
AWSome day 2018 - API serverless with aws por
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with awsCorley S.r.l.
203 visualizações38 slides
AWSome day 2018 - database in cloud por
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloudCorley S.r.l.
195 visualizações36 slides
Trace your micro-services oriented application with Zipkin and OpenTracing por
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Corley S.r.l.
1.3K visualizações46 slides
Apiconf - The perfect REST solution por
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solutionCorley S.r.l.
305 visualizações14 slides

Mais de Corley S.r.l.(20)

Aws rekognition - riconoscimento facciale por Corley S.r.l.
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
Corley S.r.l.313 visualizações
AWSome day 2018 - scalability and cost optimization with container services por Corley S.r.l.
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.273 visualizações
AWSome day 2018 - API serverless with aws por Corley S.r.l.
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
Corley S.r.l.203 visualizações
AWSome day 2018 - database in cloud por Corley S.r.l.
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
Corley S.r.l.195 visualizações
Trace your micro-services oriented application with Zipkin and OpenTracing por Corley S.r.l.
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
Corley S.r.l.1.3K visualizações
Apiconf - The perfect REST solution por Corley S.r.l.
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solution
Corley S.r.l.305 visualizações
Apiconf - Doc Driven Development por Corley S.r.l.
Apiconf - Doc Driven DevelopmentApiconf - Doc Driven Development
Apiconf - Doc Driven Development
Corley S.r.l.202 visualizações
Authentication and authorization in res tful infrastructures por Corley S.r.l.
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
Corley S.r.l.278 visualizações
Flexibility and scalability of costs in serverless infrastructures por Corley S.r.l.
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
Corley S.r.l.174 visualizações
React vs Angular2 por Corley S.r.l.
React vs Angular2React vs Angular2
React vs Angular2
Corley S.r.l.629 visualizações
A single language for backend and frontend from AngularJS to cloud with Clau... por Corley S.r.l.
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
Corley S.r.l.349 visualizações
AngularJS: Service, factory & provider por Corley S.r.l.
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
Corley S.r.l.1.5K visualizações
The advantage of developing with TypeScript por Corley S.r.l.
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
Corley S.r.l.1.3K visualizações
Angular coding: from project management to web and mobile deploy por Corley S.r.l.
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
Corley S.r.l.893 visualizações
Corley cloud angular in cloud por Corley S.r.l.
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
Corley S.r.l.801 visualizações
Measure your app internals with InfluxDB and Symfony2 por Corley S.r.l.
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
Corley S.r.l.4.5K visualizações
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda por Corley S.r.l.
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Corley S.r.l.3.6K visualizações
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L... por Corley S.r.l.
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Corley S.r.l.6.3K visualizações
Middleware PHP - A simple micro-framework por Corley S.r.l.
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.8.3K visualizações
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015 por Corley S.r.l.
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
Corley S.r.l.2.6K visualizações

Último

IWISS Catalog 2022 por
IWISS Catalog 2022IWISS Catalog 2022
IWISS Catalog 2022Iwiss Tools Co.,Ltd
24 visualizações66 slides
Solar PV por
Solar PVSolar PV
Solar PVIwiss Tools Co.,Ltd
12 visualizações4 slides
Design and analysis of a new undergraduate Computer Engineering degree – a me... por
Design and analysis of a new undergraduate Computer Engineering degree – a me...Design and analysis of a new undergraduate Computer Engineering degree – a me...
Design and analysis of a new undergraduate Computer Engineering degree – a me...WaelBadawy6
52 visualizações4 slides
MK__Cert.pdf por
MK__Cert.pdfMK__Cert.pdf
MK__Cert.pdfHassan Khan
7 visualizações1 slide
A multi-microcontroller-based hardware for deploying Tiny machine learning mo... por
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...IJECEIAES
10 visualizações10 slides
Wire Rope por
Wire RopeWire Rope
Wire RopeIwiss Tools Co.,Ltd
8 visualizações5 slides

Último(20)

Design and analysis of a new undergraduate Computer Engineering degree – a me... por WaelBadawy6
Design and analysis of a new undergraduate Computer Engineering degree – a me...Design and analysis of a new undergraduate Computer Engineering degree – a me...
Design and analysis of a new undergraduate Computer Engineering degree – a me...
WaelBadawy652 visualizações
MK__Cert.pdf por Hassan Khan
MK__Cert.pdfMK__Cert.pdf
MK__Cert.pdf
Hassan Khan7 visualizações
A multi-microcontroller-based hardware for deploying Tiny machine learning mo... por IJECEIAES
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
IJECEIAES10 visualizações
CHI-SQUARE ( χ2) TESTS.pptx por ssusera597c5
CHI-SQUARE ( χ2) TESTS.pptxCHI-SQUARE ( χ2) TESTS.pptx
CHI-SQUARE ( χ2) TESTS.pptx
ssusera597c520 visualizações
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L... por Anowar Hossain
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
Anowar Hossain10 visualizações
Multi-objective distributed generation integration in radial distribution sy... por IJECEIAES
Multi-objective distributed generation integration in radial  distribution sy...Multi-objective distributed generation integration in radial  distribution sy...
Multi-objective distributed generation integration in radial distribution sy...
IJECEIAES15 visualizações
2_DVD_ASIC_Design_FLow.pdf por Usha Mehta
2_DVD_ASIC_Design_FLow.pdf2_DVD_ASIC_Design_FLow.pdf
2_DVD_ASIC_Design_FLow.pdf
Usha Mehta14 visualizações
MSA Website Slideshow (16).pdf por msaucla
MSA Website Slideshow (16).pdfMSA Website Slideshow (16).pdf
MSA Website Slideshow (16).pdf
msaucla39 visualizações
Thermal aware task assignment for multicore processors using genetic algorithm por IJECEIAES
Thermal aware task assignment for multicore processors using genetic algorithm Thermal aware task assignment for multicore processors using genetic algorithm
Thermal aware task assignment for multicore processors using genetic algorithm
IJECEIAES29 visualizações
SWM L1-L14_drhasan (Part 1).pdf por MahmudHasan747870
SWM L1-L14_drhasan (Part 1).pdfSWM L1-L14_drhasan (Part 1).pdf
SWM L1-L14_drhasan (Part 1).pdf
MahmudHasan74787048 visualizações
13_DVD_Latch-up_prevention.pdf por Usha Mehta
13_DVD_Latch-up_prevention.pdf13_DVD_Latch-up_prevention.pdf
13_DVD_Latch-up_prevention.pdf
Usha Mehta9 visualizações
Machine Element II Course outline.pdf por odatadese1
Machine Element II Course outline.pdfMachine Element II Course outline.pdf
Machine Element II Course outline.pdf
odatadese16 visualizações
Investor Presentation por eser sevinç
Investor PresentationInvestor Presentation
Investor Presentation
eser sevinç16 visualizações
Update 42 models(Diode/General ) in SPICE PARK(DEC2023) por Tsuyoshi Horigome
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Tsuyoshi Horigome18 visualizações

Raspberry Pi - HW/SW Application Development

  • 1. Raspberry Pi HW/SW Application Development Make your own shield and control peripheral using RPi Walter Dal Mut & Francesco Ficili
  • 2. Intro to RPi ● Basically a Microcomputer on a ‘Credit Card sized’ board ● Based on a Broadcom SoC ● Many different interfaces: USB, Ethernet, HDMI, SD, TFT Display... Model B Model B+
  • 3. ...And a Mysterious Thing ● The RPi GPIO (General Purpose IO) Connector contains all low-level interface of the board. ● Usually not known by high-level software programmers. ● Well known by embedded software developers. ● It’s the best choice to make board functionalities expansions.
  • 4. Interface Options ● GPIO: the General Purpose Input Output is the most simple interface of the board. It can writes or reads the status of a single pin. ● UART: the Universal Asyncronous Receiver Transmitter is one of the most used serial standard in data communication. It’s the TTL level version of the old PC RS232 interface (tty under Linux). It is a full-duplex point-to-point standard. ● I2C: the Inter Integrated Circuit (aka I square C) is a communication standard developed by Philips during ‘80. It’s a address oriented, half-duplex, master-slave multidrop standard. It also support a multi-master variant. ● SPI: the Serial Peripheral Interface is a communication standard developed by Motorola. It is a master-slave multidrop full-duplex standard.
  • 5. The ‘Shield’ Concept ● Shield Definition (from Arduino Website): “Shields are boards that can be plugged on top of the Arduino PCB extending its capabilities” ● So a Shiled is, basically, an application-oriented expansion board that is managed by the main board through one of its interfaces. Example of RPi Shield (GSM/GPRS Shield) Arduino ZigBee Shiled RPi to Arduino Shields Adapter
  • 6. Build a Custom Shield ● Many different type of shields available on the market. ● Sometimes the range of available shields could not fit a particular application or you may have the idea of build your shield by your own. ● To build a custom shield you need: ○ An electronic CAD for design, ○ A PCB maker, ○ Shield components, ○ Assembly operations. ● Many PCB maker provide assembly service.
  • 7. KiCAD EDAS ● Many different type of EDAS (Electronic Design Automation Suite) available nowadays: ORCAD, Mentor, Allegro, Altium Designer… ● Expensive Licensing, too complex for the task, too much tool inside the suite… Not suitable for RPi shields development. ● Some free open source EDAS developed through years by electronic entusiasts are now reaching a good maturity level. ● KiCAD is one of this tools!!!
  • 8. Why KiCAD? ● Completely free and open source, ○ http://www.kicad-pcb.org/ ● Cross-platform (Linux, MacOS and Win), ● Simple to use (getting started is only 27 pages long), ● Very large community of users that shares component libraries, ● Examples: ○ http://smisioto.no-ip.org/elettronica/kicad/kicad.htm (useful lid for hobbysts) ○ http://kicad.rohrbacher.net/quicklib.php (component generator) ○ http://www.kicadlib.org/ (libraries collection) ○ … and many others
  • 9. Suite Description ● It comprises a schematic editor, layout editor, gerber visualization tools and provide a simple interface for output files generation, Kicad Project Manager
  • 13. Layout Editor Navigation Shield Layout
  • 14. Examples ● Navigation Shield ○ GPS Unit (over UART link) ○ IMU Unit (over I2C link) ○ GP LEDs ○ Possible application: rovers or drone navigation control ● Smart I/O Shield ○ 5 Analog Inputs, ○ 8 Digital I/O (2 PWM), ○ PIC18F2550 with I2C interface ○ Possible application: I/O expander for RPI (acquisition, control…).
  • 15. Build your prototype ● PCB (need gerber files): ○ Md srl: http://www.mdsrl.it/ (very professional service) ○ PCBProto: http://www.pcb-proto.com/ (very large pool) ○ JackAltac: http://www.jackaltac.com/ (cheaper one) ● Components (need Bill of Material): ○ Farnell, RS, Futura... ● Assembly (in case of pick-and-place need module position files) ○ Md srl is now providing an assembly service (quite expensive for small numbers) ○ ...otherwise buy a solder station
  • 17. GPIO - General Purpose In/Out ● GPIO strip provides different communication layers (board to board or on single board) ○ Generic In/Out pins (different libraries) ○ UART - Serial Communication ○ I2C - InterIntegrated Circuit ○ SPI - Serial Peripheral Interface
  • 18. GPIO - Support Libraries ● Not included by default ○ http://www.airspayce.com/mikem/bcm2835/bcm2835-1.37.tar.gz ./configure make sudo make check sudo make install
  • 19. int main(void) { if (!bcm2835_init()) { exit(1); } bcm2835_gpio_fsel(RPI_V2_GPIO_P1_11, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(RPI_V2_GPIO_P1_13, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(RPI_V2_GPIO_P1_15, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(RPI_V2_GPIO_P1_11, HIGH); bcm2835_gpio_write(RPI_V2_GPIO_P1_13, HIGH); bcm2835_gpio_write(RPI_V2_GPIO_P1_15, HIGH); return 0; }
  • 20. int main(void) { if (!bcm2835_init()) { exit(1); } bcm2835_gpio_fsel(RPI_V2_GPIO_P1_11, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(RPI_V2_GPIO_P1_13, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(RPI_V2_GPIO_P1_15, BCM2835_GPIO_FSEL_OUTP); uint8_t c = 0; while (1) { bcm2835_gpio_write(RPI_V2_GPIO_P1_11, c); bcm2835_gpio_write(RPI_V2_GPIO_P1_13, c); bcm2835_gpio_write(RPI_V2_GPIO_P1_15, c); c = !c; sleep(1); } return 0; }
  • 21. GPIO - BCM2835 - board versions ● Model A ○ RPI_GPIO_P1_03 ○ RPI_GPIO_P1_05 ○ RPI_GPIO_P1_07 ● Model B ○ RPI_V2_GPIO_P1_03 ○ RPI_V2_GPIO_P1_05 ○ RPI_V2_GPIO_P1_07 ● Model B+ RPI_BPLUS_GPIO_J8_03 RPI_BPLUS_GPIO_J8_05 RPI_BPLUS_GPIO_J8_07 http://www.airspayce.com/mikem/bcm2835/bcm2835_8h_source.html
  • 22. GPIO in action Low-cost ultrasonic sensors turn on/off a pin in order to convert real distances HC-SR04 https://github.com/wdalmut/libultrasonic
  • 23. UART for Raspberry Pi ● 2 functional modes ○ TTY for terminal connections (serial console) ○ For other micros and components ● Peripheral mode need few configurations ○ Appears as /dev/ttyAMA0 ○ http://elinux. org/RPi_Serial_Connection#Connection_to_a_micro controller_or_other_peripheral
  • 25. Initialize your serial module void serial_init(void) { uart0_filestream = open(“/dev/ttyAMA0”, O_RDWR | O_NOCTTY | O_NDELAY); if (uart0_filestream == -1) { //TODO error handling... } }
  • 26. Config your UART registry void serial_config(void) { struct termios options; tcgetattr(uart0_filestream, &options); options.c_cflag = B9600 | CS8 | CLOCAL | CREAD; options.c_iflag = IGNPAR; options.c_oflag = 0; options.c_lflag = 0; tcflush(uart0_filestream, TCIFLUSH); tcsetattr(uart0_filestream, TCSANOW, &options); }
  • 27. Send data to your peripheral int count = write(uart0_filestream, data, dataLen); Pay attention with strings (char vectors) because dataLen doesn’t include the termination byte (“0”)
  • 28. Read data from your peripheral int rx_length = read(uart0_filestream, (void*)(&c), len);
  • 29. A navigation shield for Raspberry Pi Adafruit Ultimate GPS Breakout v3 UART GPS module https://github.com/wdalmut/libgps
  • 30. I2C - Inter-Integrated Circuit ● Multiple components uses I2C in order to communicate ● Raspberry PI supports also this peripherals as a master node ● On raspberry the I2C is disabled by default, you have to enable it! ○ Enable it in your: /etc/modprobe.d/raspi-blacklist. conf
  • 32. I2C - Initialize it void mma7660fc_init(void) { i2cdev = open(“/dev/i2c-1”, O_RDWR); if (i2cdev == -1) { //TODO handle errors } }
  • 33. I2C - Write and control your slaves! void mma7660fc_on(void) { uint8_t buffer[2]; buffer[0] = MMA7660_MODE; buffer[1] = MMA7660_ACTIVE; ioctl(i2cdev, I2C_SLAVE, MMA7660_ADDR); write(i2cdev, buffer, 2); }
  • 34. Read from your slaves void mma7660fc_get(accel_t *data) { uint8_t buffer[11]; ioctl(i2cdev, I2C_SLAVE, MMA7660_ADDR); read(i2cdev, buffer, 3); //only x,y,z data->x = mma7660fc_convert(buffer[0]); data->y = mma7660fc_convert(buffer[1]); data->z = mma7660fc_convert(buffer[2]); }
  • 35. i2c in action MMA7660 ● 3-axis accelerometer ● Tilt detection ● Movement detection https://github.com/wdalmut/libimu
  • 36. Higher level with Golang package gps import( // #cgo LDFLAGS: -lgps -lm // #include <gps.h> "C" ) func GpsLocation() (float64, float64) { var data C.loc_t var lat, lon float64 C.gps_location(&data) lat = float64(data.latitude) lon = float64(data.longitude) return lat, lon }
  • 37. Any question? Thanks for listening