Start on v2
This commit is contained in:
parent
4d5c26d10c
commit
e9ae1a320a
43 changed files with 608 additions and 4 deletions
32
server_v2/include/reset.hpp
Normal file
32
server_v2/include/reset.hpp
Normal 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
|
Reference in a new issue