Commit 1d41f9ae authored by Nathan Girard's avatar Nathan Girard
Browse files

ajout de la souris et clavier pour la manette

parent 72fe99a0
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>17</FileNumber> <FileNumber>17</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\BSP\Driver\bsp_uart.c</PathWithFileName> <PathWithFileName>..\BSP\Driver\bsp_uart.c</PathWithFileName>
......
...@@ -70,7 +70,7 @@ int16_t led_cnt; ...@@ -70,7 +70,7 @@ int16_t led_cnt;
float target_speed; float target_speed;
motor_t m2006; motor_t m2006;
extern rc_info_t rc; extern RC_ctrl_t rc_ctrl;
//char buf[200]; //char buf[200];
//uint16_t pwm_pulse = 1080; // default pwm pulse width:1080~1920 //uint16_t pwm_pulse = 1080; // default pwm pulse width:1080~1920
...@@ -186,10 +186,10 @@ int main(void) ...@@ -186,10 +186,10 @@ int main(void)
// PWM_SetAllDuty(&htim1, 0, 0, 0, 0); // PWM_SetAllDuty(&htim1, 0, 0, 0, 0);
} }
m3508_frontleft.target = 4*rc.ch1 + 4*rc.ch2; m3508_frontleft.target = 4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1];
m3508_frontright.target = -(4*rc.ch1 - 4*rc.ch2); m3508_frontright.target = -(4*rc_ctrl.rc.ch[0] - 4*rc_ctrl.rc.ch[1]);
m3508_backleft.target = -(4*rc.ch1 + 4*rc.ch2); m3508_backleft.target = -(4*rc_ctrl.rc.ch[0] + 4*rc_ctrl.rc.ch[1]);
m3508_backright.target = 4*rc.ch1 - 4*rc.ch2; m3508_backright.target = 4*rc_ctrl.rc.ch[0] - 4*rc_ctrl.rc.ch[1];
get_motor_data(&m3508_frontleft); get_motor_data(&m3508_frontleft);
get_motor_data(&m3508_frontright); get_motor_data(&m3508_frontright);
...@@ -199,20 +199,20 @@ int main(void) ...@@ -199,20 +199,20 @@ int main(void)
get_motor_data(&gm6020); get_motor_data(&gm6020);
/*Affichage de donnees sur le OLED*/ /*Affichage de donnees sur le OLED*/
oled_clear(Pen_Clear);
oled_printf(1, 1, "GM6020");
oled_printf(2, 1," Target: %f", gm6020.target);
oled_printf(3, 1," Speed: %i", gm6020.info.M3508_info.speed);
oled_printf(4, 1," Angle: %i", gm6020.info.M3508_info.angle);
oled_refresh_gram();
// oled_clear(Pen_Clear); // oled_clear(Pen_Clear);
// oled_printf(0, 1, "Manette"); // oled_printf(1, 1, "GM6020");
// oled_printf(1, 1," CH1: %i", rc.ch1); // oled_printf(2, 1," Target: %f", gm6020.target);
// oled_printf(2, 1," CH2: %i", rc.ch2); // oled_printf(3, 1," Speed: %i", gm6020.info.M3508_info.speed);
// oled_printf(3, 1," CH3: %i", rc.ch3); // oled_printf(4, 1," Angle: %i", gm6020.info.M3508_info.angle);
// oled_printf(4, 1," CH4: %i", rc.ch4);
// oled_refresh_gram(); // oled_refresh_gram();
oled_clear(Pen_Clear);
oled_printf(0, 1, "Manette");
oled_printf(1, 1," CH1: %i", rc_ctrl.rc.ch[0]);
oled_printf(2, 1," CH2: %i", rc_ctrl.rc.ch[1]);
oled_printf(3, 1," CH3: %i", rc_ctrl.rc.ch[2]);
oled_printf(4, 1," CH4: %i", rc_ctrl.rc.ch[3]);
oled_refresh_gram();
/* led blink */ /* led blink */
led_cnt ++; led_cnt ++;
......
Supports Markdown
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