brighrness, speed 460800

This commit is contained in:
2021-11-16 23:18:32 +01:00
parent 20eda9fc42
commit 9603093b62
2 changed files with 8 additions and 5 deletions

View File

@@ -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");

View File

@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usbserial-dw
PKG_VERSION:=0.3.6
PKG_VERSION:=0.3.7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git