Commit 04f14828 authored by liubryan's avatar liubryan
Browse files

Update Serial_Backpack_LCD.c

parent 941904bc
......@@ -12,6 +12,11 @@ void clear_screen() {
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
void invert() {
uint8_t tx_buf[2] = {CONTROL, 0x12};
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
void set_duty_cycle(uint8_t duty) {
uint8_t tx_buf[3] = {CONTROL, 0x02, duty};
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
......@@ -82,9 +87,10 @@ void initialize(uint8_t duty) {
void display_inprogress() {
//{'P', 'r', 'i', 'n', 't', 'i', 'n', 'g', '.', '.', '.'}
uint8_t tx_buf[] = "Printing...";
set_coordinates(44, 80);
set_coordinates(44, 95);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf)-1);
draw_erase_shape(BOX, BARSTART_X, BARSTART_Y, BAREND_X, BAREND_Y, 1);
//fill(BARSTART_X, BARSTART_X+progress);
}
void display_completed() {
......@@ -109,8 +115,8 @@ void write_temp(int temp){
tx_buff[6]=numToAscii((temp/10)%10);
tx_buff[7]=numToAscii(temp%10);
tx_buff[8]='C';
set_coordinates(44, 90);
MSS_UART_polled_tx(&g_mss_uart1, tx_buff, sizeof(tx_buff));
set_coordinates(44, 90);
MSS_UART_polled_tx(&g_mss_uart1, tx_buff, sizeof(tx_buff));
}
void fill(uint8_t start, uint8_t end) {
......@@ -247,3 +253,43 @@ void delay(uint32_t count) {
uint32_t i = 0;
for (; i < count ; ++i) {}
}
void display_temp(uint8_t temp) {
set_coordinates(2, 60);
uint8_t tx_buf[12];
sprintf(tx_buf, "Temp(C): %u", temp);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
void display_orientation(uint16_t yaw) {
set_coordinates(2, 50);
uint8_t tx_buf[13];
sprintf(tx_buf, "Yaw(deg): %u ", yaw);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
void display_stepper(int8_t x, int8_t y) {
set_coordinates(2, 40);
uint8_t tx_buf[14];
sprintf(tx_buf, "StepX(cm): %i ", x);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
set_coordinates(2, 30);
sprintf(tx_buf, "StepY(cm): %i ", y);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
void display_mouse(int8_t x, int8_t y) {
set_coordinates(2, 20);
uint8_t tx_buf[17];
sprintf(tx_buf, "MouseX(10um): %i ", x);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
set_coordinates(2, 10);
sprintf(tx_buf, "MouseY(10um): %i ", y);
MSS_UART_polled_tx(&g_mss_uart1, tx_buf, sizeof(tx_buf));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment