Inital commit
This commit is contained in:
33
main.c
Normal file
33
main.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "uvosled.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
struct uvosled led;
|
||||
|
||||
if(uvosled_connect(&led))
|
||||
{
|
||||
printf("cant connect \n");
|
||||
return -1;
|
||||
}
|
||||
if(uvosled_poweron(&led))
|
||||
{
|
||||
printf("cant power on \n");
|
||||
return -2;
|
||||
}
|
||||
if(uvosled_set_current(&led, CHANNEL_A | CHANNEL_B , 0.5))
|
||||
{
|
||||
printf("cant set current \n");
|
||||
return -3;
|
||||
}
|
||||
sleep(30);
|
||||
if(uvosled_set_current(&led, CHANNEL_A | CHANNEL_B , 0))
|
||||
{
|
||||
printf("cant set current \n");
|
||||
return -3;
|
||||
}
|
||||
uvosled_poweroff(&led);
|
||||
uvosled_disconnect(&led);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user