upm/examples/c/led.c
Jon Trulson e7c80217c2 C examples: move mraa_init() calls out of C examples and into C drivers.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-28 17:34:42 -06:00

28 lines
558 B
C

//Modified: Abhishek Malik <abhishek.malik@intel.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "led.h"
#include "upm_utilities.h"
int main(void)
{
led_context dev = led_init(2);
while(1){
if(led_on(dev) != UPM_SUCCESS){
printf("problem turning the LED on\n");
}
upm_delay(1);
if(led_off(dev) != UPM_SUCCESS){
printf("problem turning the LED off\n");
}
upm_delay(1);
}
led_close(dev);
return 0;
}