Inital commit

This commit is contained in:
2021-06-12 12:53:02 +02:00
commit ed43fb747a
6 changed files with 486 additions and 0 deletions

33
main.c Normal file
View 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;
}