MRAA pinmap (Failed to initialize)
Hi, I'm trying to control the pin of the UP2 board.
When I tried the example provided by MRAA github
mraa/examples/c/led.c (Sorry for the chaotic typesetting below)
include <stdio.h>
include <stdlib.h>
include <unistd.h>
/* mraa header */
include "mraa/led.h"
include "mraa.h"
/* LED name */
define USER_LED 0
/* trigger type */
define LED_TRIGGER "heartbeat"
int
main(void)
{
mraa_result_t status = MRAA_SUCCESS;
mraa_led_context led;
int val;
/* initialize mraa for the platform (not needed most of the time) */ mraa_init(); //! [Interesting] /* initialize LED */ led = mraa_led_init(USER_LED); if (led == NULL) { fprintf(stderr, "Failed to initialize LED\n"); mraa_deinit(); return EXIT_FAILURE; }
with the error output:
Failed to initialize LED
But when I tried mraa/examples/hellomraa
It will run correctly with the output:
hello mraa
Version: v2.0.0
Running on UP2
I surmise that problem is I didn't link the pinmapping (pin definition) file correctly, but I can't figure out what should I do.
Or is there any problem I have not found yet?
Thanks!
Categories
- All Categories
- 63 Announcements & News
- 48 Product News - New Product/Product Change Notice/ End-of-life
- 96 Welcome Developers!
- 46 Unboxing & Project Sharing
- 22 Tech Updates
- 3.4K UP Products
- 17 UP 7000
- 1 UP Squared i12
- 11 UP Xtreme i12
- 13 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 23 UP Squared V2
- 65 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 56 UP Squared Pro
- 136 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 264 Starter Kits & Peripheral