| Electronic Components Datasheet Search |
|
DEV-13044 Datasheet(PDF) 9 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13044 Datasheet(HTML) 9 Page - SparkFun Electronics |
|
9 / 11 page ![]() // We *know* that if the IO pin reads as 0, or is low, rea d() returns zero. // However, if it's high, it *may* return something els e; the only guarantee // is that it will be nonzero. Thus, don't test to see i f a read() returned // a 1!!! if (buttonPin.read() == 0) { LEDPin.write(1); sleep(1); LEDPin.write(0); sleep(1); } } return MRAA_SUCCESS; } Additional Examples Because this block is just a GPIO access device, the existing MRAA GPIO examples can be used with it. Example projects in the IDE When you create a new project in the Eclipse IDE, it will offer you the option of several starter projects. Some of them, noted above, are good examples of using the MRAA GPIO functions. They’re more complex than what we’ve provided here, however. For full documentation of the C++ API for GPIO pins, please visit the official MRAA documentation. Resources and Going Further Pin Map You might have noticed that we used GP46 in hardware and GPIO 32 in our example code. This is because the MRAA library uses a different number for the pins. If you would like to use MRAA to control hardware, figure out which GPIO pins you plan to use on the table below (labeled “Edison Pin”) and then use the MRAA Number in software. The available pins on the Pi Block have been highlighted in yellow in the table. Notes: • Input/output voltage on the Pi Block is 3.3V • Input/output voltage on the GPIO Block is 3.3V by default • Input/output voltage on the Arduino Breakout is 5V • Input/output voltage on the Mini Breadboard is 1.8V MRAA pin map table based on Intel’s IOT Dev Kit Repository Edison Pin (Linux) Arduino Breakout Mini Breakout MRAA Number Pinmode0 Pinmode1 Pinmode2 GP12 3 J18-7 20 GPIO-12 PWM0 GP13 5 J18-1 14 GPIO-13 PWM1 GP14 A4 J19-9 36 GPIO-14 Page 9 of 11 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |