Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************
- RoboCar LED Control Program
- **************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include "uart_api.h"
- #include "robot_protocol.h"
- int main(void)
- {
- int ret;
- char led_brightness;
- ret = user_uart1_open("S1"); // UART Device connected to RoboCar
- if (ret < 0)
- {
- printf("\n UART1 open error!");
- exit(0);
- }
- user_uart1_confing(115200, 8, UART_PARNONE, 1);
- for (led_brightness = 0; led_brightness <= 100; led_brightness += 10)
- {
- RoboCAR_FrontLED_Control(led_brightness);
- RoboCAR_BackLED_Control(100-led_brightness);
- printf("\n Front LED Brightness %d %\n", led_brightness);
- printf(" Back LED Brightness %d % \n", 100-led_brightness);
- sleep(1);
- }
- user_uart1_close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement