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];
34 int oled_send_hw_status(uint8_t *buff, int buff_size, uint8_t *status)
36 if(buff_size < HW_STATUS_MSG_SIZE)
40 buff[1] = HW_STATUS_MSG;
52 int oled_set_color(uint8_t *buff, int buff_size, uint8_t color)
54 if(buff_size < COLOR_MSG_SIZE)
65 int oled_switch_mode(uint8_t *buff, int buff_size, uint8_t mode, uint8_t status)
67 if(buff_size < SWITCH_MODE_MSG_SIZE)
71 *(buff+1) = CHANGE_MODE_REP;
79 int oled_send_voltage(uint8_t *buff, int buff_size, struct pwr_voltage_type *volt)
82 if(buff_size < VOLTAGE_MSG_SIZE)
87 buff[1] = VOLTAGE_MSG;
89 sprintf((char*)(buff+2),"%1.2f",volt->voltage33);
91 sprintf((char*)(buff+6),"%1.2f",volt->voltage50);
93 sprintf((char*)(buff+10),"%1.2f",volt->voltage80);
95 sprintf((char*)(buff+14),"%2.2f",volt->voltageBAT);
97 *(buff+19) = MSG_TERM;
102 int oled_send_position(uint8_t *buff, int buff_size, struct est_pos_type *pos)
104 if(buff_size < POSITION_MSG_SIZE)
109 buff[1] = POSITION_MSG;
111 sprintf((char*)(buff+2),"%1.2f",pos->x);
113 sprintf((char*)(buff+6),"%1.2f",pos->y);
115 *(buff+10) = MSG_TERM;
119 int oled_send_fsm_state(uint8_t *buff, int buff_size, const char *name, int len)
123 if(buff_size > FSM_STATE_MSG_SIZE)
128 buff[1] = FSM_STATE_MSG;
131 buff[2+i] = MSG_TERM;