2023-10-22 16:48:14 +00:00
|
|
|
/*****
|
2024-08-15 00:20:18 +00:00
|
|
|
* Copyright (c) 2024 - Poivron Robotique
|
2023-10-22 16:48:14 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
#include "pico/stdlib.h"
|
2024-08-15 00:20:18 +00:00
|
|
|
#include "Teleplot.h"
|
2025-01-04 17:08:56 +00:00
|
|
|
#include "Temps.h"
|
2023-10-22 16:48:14 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2024-08-15 00:20:18 +00:00
|
|
|
void setup(void);
|
|
|
|
void loop(void);
|
|
|
|
|
2025-01-04 17:08:56 +00:00
|
|
|
int valeur = 1;
|
|
|
|
|
2023-10-22 16:48:14 +00:00
|
|
|
void main(void)
|
|
|
|
{
|
2024-08-15 00:20:18 +00:00
|
|
|
setup();
|
2023-10-22 16:48:14 +00:00
|
|
|
while(1){
|
2024-08-15 00:20:18 +00:00
|
|
|
loop();
|
2023-10-22 16:48:14 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-15 00:20:18 +00:00
|
|
|
|
|
|
|
void setup(void){
|
|
|
|
stdio_init_all();
|
|
|
|
Teleplot_init();
|
2025-01-04 17:08:56 +00:00
|
|
|
Temps_init();
|
2025-01-04 17:49:19 +00:00
|
|
|
|
|
|
|
// Broches des moteurs gérées en GPIO
|
|
|
|
gpio_init(7);
|
|
|
|
gpio_init(13);
|
|
|
|
gpio_init(27);
|
|
|
|
gpio_init(5);
|
|
|
|
gpio_init(10);
|
|
|
|
gpio_init(9);
|
|
|
|
|
|
|
|
// Broches des moteurs en sortie
|
|
|
|
gpio_set_dir(7, true); // M1 Sens 1
|
|
|
|
gpio_set_dir(13, true); // M1 Sens 2
|
|
|
|
gpio_set_dir(27, true); // M1 Vitesse
|
|
|
|
|
|
|
|
gpio_set_dir(5, true); // M2 Sens 2
|
|
|
|
gpio_set_dir(10, true); // M2 Sens 1
|
|
|
|
gpio_set_dir(9, true); // M2 Vitesse
|
|
|
|
|
|
|
|
// Commande des broches
|
|
|
|
gpio_put(7, 0);
|
|
|
|
gpio_put(13, 1);
|
|
|
|
gpio_put(27, 1);
|
|
|
|
|
|
|
|
gpio_put(5, 0);
|
|
|
|
gpio_put(10, 1);
|
|
|
|
gpio_put(9, 1);
|
|
|
|
|
2024-08-15 00:20:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop(void){
|
2025-01-04 17:49:19 +00:00
|
|
|
tight_loop_contents();
|
2024-08-15 00:20:18 +00:00
|
|
|
}
|