Intel Edison Tutorial 4 - GPIO and I2C Interfaces - IoT Platform Intel Edison Tutorial 4 GPIO and I2C Interfaces Intel Edison Tutorial 4 GPIO and I2C

Intel Edison Tutorial 4 - GPIO and I2C Interfaces - IoT...

This preview shows page 1 - 5 out of 15 pages.

Intel ® Edison Tutorial 4: GPIO and I2C Interfaces 1 IoT Platform Intel ® Edison Tutorial 4: GPIO and I2C Interfaces
Image of page 1
Intel ® Edison Tutorial 4: GPIO and I2C Interfaces 2 Table of Contents Introduction ..................................................................................................................... 3 Things Needed ................................................................................................................ 3 I/O Programming on Intel Edison .................................................................................. 4 MRAA Library .................................................................................................................. 4 GPIO (General Purpose Input/Output) .......................................................................... 5 GPIO Interrupt ................................................................................................................. 7 Analog Input .................................................................................................................. 10 I2C (Inter-Integrated Circuit) ........................................................................................ 12 Appendix ....................................................................................................................... 15 References .................................................................................................................... 15 Revision history Version Date Comment 1.0 9/24/2015 Initial release 2.0 1/10/2016 Modified examples
Image of page 2
Intel ® Edison Tutorial 4: GPIO and I2C Interfaces 3 Introduction In this tutorial, you will: 1. Be introduced to MRAA library, 2. Learn to access the GPIOs on the Edison in Arduino and C, 3. Learn to set an interrupt on a GPIO in C, 4. Learn to read the analog input on the Edison in Arduino and C, and 5. Learn to implement I2C between the Edison and the Arduino Uno. Things Needed 1. An Intel Edison with Arduino-compatible breakout, 2. A micro USB cable, 3. A Grove Starter kit, and 4. A PC or Mac
Image of page 3
Intel ® Edison Tutorial 4: GPIO and I2C Interfaces 4 I/O Programming on Intel Edison With the Arduino-compatible breakout board, I/O programming can be easily done by writing Arduino sketches. However, only one sketch can be uploaded to an Edison board and it is overwritten when a new sketch is uploaded. Instead, we can write a program that is saved in the Edison’s internal memory (4GB of eMMC flash) and execute it whenever we need. For instance, you can implement the simple web server example from the previous tutorial in C rather than as an Arduino sketch. Then, write another web server application that controls another pin in a different port. You can simultaneously run these applications and open two browsers and control different components. As you have discovered in the previous tutorials, the Yocto Embedded Linux image enables C development on the Edison. In this tutorial, we will discuss about how to do I/O programming in C. In addition, you can check out the Appendix if you want to learn about I/O programming on the Intel Edison in Python and JavaScript. MRAA Library I/O programming on the Edison is made easier with a library called MRAA. Libmraa is a C/C++ library with bindings to JavaScript & Python to interface with the IO on Galileo, Edison & other platforms, with a structured and sane API where port names/numbering matches the board that you are on [1]. This library allows developers control low-level communication protocol by high-level language. The Yocto Embedded Linux image includes MRAA library. Let’s first
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 15 pages?

  • Winter '15
  • WilliamKaiser
  • ........., Universal Serial Bus, Interrupt, Serial port

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture