Start on v2

This commit is contained in:
root 2022-05-21 13:10:28 +01:00
parent 4d5c26d10c
commit e9ae1a320a
43 changed files with 608 additions and 4 deletions

View file

@ -0,0 +1,32 @@
#ifndef COMPLIB_SERVER_RESET_HPP
#define COMPLIB_SERVER_RESET_HPP
#include <pigpio.h>
#include <unistd.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