brighrness, speed 460800
This commit is contained in:
11
main.cpp
11
main.cpp
@@ -114,7 +114,7 @@ int main(int argc, char* argv[])
|
||||
float pressure = NAN;
|
||||
po::variables_map vm;
|
||||
std::string port,path,filename;
|
||||
int speed,brightness,saturation,contrast;
|
||||
int speed,brightness = 0,saturation = 0 ,contrast = 0;
|
||||
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
@@ -127,9 +127,9 @@ int main(int argc, char* argv[])
|
||||
("capture", "capture photo of camera")
|
||||
("port", po::value<string>(&port)->default_value("/dev/ttyUSB0"), "port to read from")
|
||||
("speed", po::value<int>(&speed)->default_value(460800), "speed read from port")
|
||||
("brightness", po::value<int>(&brightness)->default_value(0), "set brightness")
|
||||
("saturation", po::value<int>(&saturation)->default_value(0), "set saturation")
|
||||
("contrast", po::value<int>(&contrast)->default_value(0), "set contrast")
|
||||
("brightness", po::value<int>(&brightness)->implicit_value(0), "set brightness")
|
||||
("saturation", po::value<int>(&saturation)->implicit_value(0), "set saturation")
|
||||
("contrast", po::value<int>(&contrast)->implicit_value(0), "set contrast")
|
||||
("temperature", "get and print temprature")
|
||||
("humidity", "get and print humidity")
|
||||
("pressure", "get and print pressure")
|
||||
@@ -187,6 +187,8 @@ int main(int argc, char* argv[])
|
||||
boost::this_thread::sleep(posix_time::milliseconds(5000));
|
||||
|
||||
if (! vm.count("noreset")) {
|
||||
serial.writeString("\r\n\r\n");
|
||||
boost::this_thread::sleep(posix_time::milliseconds(300));
|
||||
line = serial.readStringUntil("\n");
|
||||
trim(line);
|
||||
BOOST_LOG_TRIVIAL(debug) << line;
|
||||
@@ -194,6 +196,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (vm.count("measure") || vm.count("temperature") || vm.count("pressure") || vm.count("humidity")) {
|
||||
serial.writeString("measure\r\n");
|
||||
boost::this_thread::sleep(posix_time::milliseconds(100));
|
||||
|
||||
for (;;) {
|
||||
line = serial.readStringUntil("\n");
|
||||
|
||||
Reference in New Issue
Block a user