Add encoder with filter

This commit is contained in:
root 2022-03-20 21:21:54 +00:00
parent 5ecf92426a
commit 8537e8504b
60 changed files with 593 additions and 8208 deletions

31
server/include/reset.hpp Normal file
View file

@ -0,0 +1,31 @@
#ifndef COMPLIB_SERVER_RESET_HPP
#define COMPLIB_SERVER_RESET_HPP
#include <pigpio.h>
#define RESET_PIN 23
#define BOOT_PIN 17
#define RESET_SLEEP_TIME_US 1000 * 100
#define RESET_STARTUP_SLEEP_TIME_US 1000 * 500
namespace Reset {
void reset_robot() {
gpioInitialise();
gpioSetMode(BOOT_PIN, PI_OUTPUT);
gpioSetMode(RESET_PIN, PI_OUTPUT);
gpioWrite(BOOT_PIN, 0);
gpioWrite(RESET_PIN, 0);
usleep(RESET_SLEEP_TIME_US);
gpioWrite(RESET_PIN, 1);
usleep(RESET_STARTUP_SLEEP_TIME_US);
}
}
#endif //COMPLIB_SERVER_RESET_HPP