From 3b33d88f5621a8d40ccf4c0177c98f63a5c19c38 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 1 Jan 1970 01:45:37 +0100 Subject: Initial commit --- main.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..d3ec2ae --- /dev/null +++ b/main.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include // let the user use this with a screen, too +using namespace std; +void parse_args(int argc, char* argv[]) +{ + // nothing for now +} +int main(int argc, char* argv[]) +{ + if(geteuid()!=0) // must be root to control LEDS! + { + cerr << "Need to be root to control LEDs!"<< endl; + cerr << "Current user ID: " << geteuid() << endl; + return 1; + } + parse_args(argc, argv); + cout << "PiSH initializied." << endl; + dash(); + usleep(250000); + dash(); + usleep(250000); + string cmd; + while(cmd!="exit") + { + dot(); + cout << "PiSH> "; + getline(cin, cmd); + dash(); + usleep(250000); + } +} + -- cgit v1.1