10 #include <robottype_eb2008.h>
11 #include <robot_eb2008.h>
15 int oled_set_balls(uint8_t *buff, int buff_size, uint8_t *carousel)
17 if(buff_size < BALLS_MSG_SIZE)
22 buff[2] = carousel[0];
23 buff[3] = carousel[1];
24 buff[4] = carousel[2];
25 buff[5] = carousel[3];
26 buff[6] = carousel[4];
33 int oled_send_hw_status(uint8_t *buff, int buff_size, uint8_t *status)
35 if(buff_size < HW_STATUS_MSG_SIZE)
39 buff[1] = HW_STATUS_MSG;
50 int oled_set_color(uint8_t *buff, int buff_size, uint8_t color)
52 if(buff_size < COLOR_MSG_SIZE)
62 int oled_switch_mode(uint8_t *buff, int buff_size, uint8_t mode, uint8_t status)
64 if(buff_size < SWITCH_MODE_MSG_SIZE)
68 *(buff+1) = CHANGE_MODE_REP;
76 int oled_send_voltage(uint8_t *buff, int buff_size, struct pwr_voltage_type *volt)
79 if(buff_size < VOLTAGE_MSG_SIZE)
84 buff[1] = VOLTAGE_MSG;
86 sprintf((char*)(buff+2),"%1.2f",volt->voltage33);
88 sprintf((char*)(buff+6),"%1.2f",volt->voltage50);
90 sprintf((char*)(buff+10),"%1.2f",volt->voltage80);
92 sprintf((char*)(buff+14),"%2.2f",volt->voltageBAT);
94 *(buff+19) = MSG_TERM;
99 int oled_send_position(uint8_t *buff, int buff_size, struct est_pos_type *pos)
101 if(buff_size < POSITION_MSG_SIZE)
106 buff[1] = POSITION_MSG;
108 sprintf((char*)(buff+2),"%1.2f",pos->x);
110 sprintf((char*)(buff+6),"%1.2f",pos->y);
112 *(buff+10) = MSG_TERM;
116 int oled_send_fsm_state(uint8_t *buff, int buff_size, const char *name, int len)
120 if(buff_size > FSM_STATE_MSG_SIZE)
125 buff[1] = FSM_STATE_MSG;
128 buff[2+i] = MSG_TERM;