mirror of
https://github.com/aprochazka/ProfilometerProbe.git
synced 2025-06-30 09:37:22 +02:00
Camera progress
This commit is contained in:
BIN
Receiver/Displayer.o
Normal file
BIN
Receiver/Displayer.o
Normal file
Binary file not shown.
BIN
Receiver/ImageView.o
Normal file
BIN
Receiver/ImageView.o
Normal file
Binary file not shown.
@ -11,7 +11,7 @@ void Receiver::printHex(unsigned char value) {
|
||||
void Receiver::openStream(){
|
||||
while(1){
|
||||
// Open the CDC device file for reading
|
||||
cdcFile = open("/dev/ttyACM2", O_RDWR | O_NOCTTY);
|
||||
cdcFile = open("/dev/ttyACM1", O_RDWR | O_NOCTTY);
|
||||
if (cdcFile == -1) {
|
||||
std::cerr << "Failed to open CDC device file" << std::endl;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
|
BIN
Receiver/Receiver.o
Normal file
BIN
Receiver/Receiver.o
Normal file
Binary file not shown.
BIN
Receiver/Transfer.o
Normal file
BIN
Receiver/Transfer.o
Normal file
Binary file not shown.
BIN
Receiver/main
Executable file
BIN
Receiver/main
Executable file
Binary file not shown.
@ -9,13 +9,22 @@
|
||||
|
||||
int cdcFile;
|
||||
struct termios tty;
|
||||
void readLoop(){
|
||||
openStream(&cdcFile);
|
||||
initSerial(&tty, &cdcFile);
|
||||
|
||||
void readLoop(Receiver ** receiverPtr){
|
||||
(*receiverPtr)->openStream();
|
||||
(*receiverPtr)->initSerial();
|
||||
|
||||
while (true) {
|
||||
readCdcData(&cdcFile);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
unsigned char character[10];
|
||||
(*receiverPtr)->readCdcData(&character);
|
||||
if((*receiverPtr)->findStart(&character) != -1)
|
||||
{std::cout << "start" << std::endl;}
|
||||
else if((*receiverPtr)->findEnd(&character) != -1)
|
||||
{std::cout << "stop" << std::endl;}
|
||||
else{
|
||||
std::cout << "-";
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||
}
|
||||
|
||||
close(cdcFile);
|
||||
@ -36,12 +45,13 @@ void receiverLoop(Receiver ** receiverPtr){
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
Displayer dis;
|
||||
Receiver *rec = new Receiver(&dis);
|
||||
|
||||
/*
|
||||
dis.createWindow();
|
||||
dis.renderWindow();
|
||||
|
||||
Receiver *rec = new Receiver(&dis);
|
||||
rec->openStream();
|
||||
rec->initSerial();
|
||||
rec->fillBuffer();
|
||||
@ -52,8 +62,8 @@ int main()
|
||||
dis.windowLoop();
|
||||
|
||||
t1.join();
|
||||
*/
|
||||
|
||||
|
||||
//readLoop();
|
||||
readLoop(&rec);
|
||||
return 0;
|
||||
}
|
||||
|
BIN
Receiver/main.o
Normal file
BIN
Receiver/main.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user