Files
libuvosled/main.c
2021-06-12 12:53:02 +02:00

34 lines
570 B
C

#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;
}