Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uart_communication_main.cpp 560B

1234567891011121314151617181920212223242526
  1. #include "uart_communication.h"
  2. /*
  3. * Usage: telnet [ip] [port]
  4. * eg.: telnet 192.158.4.1 8080
  5. * To quit: ctrl + +
  6. * q
  7. */
  8. int main(void) {
  9. printf("Starting the loopback application...\r\n");
  10. LFR_UART uartCommunicator;
  11. uartCommunicator.sendTelegram(-1.0, -0.99, 0.99, 1.0);
  12. double buffer[4] = {0.0, 0.0, 0.0, 0.0};
  13. sleep(1);
  14. if(uartCommunicator.readTelegram(buffer)){
  15. for(int i = 0; i < 4; i++) {
  16. std::cout << buffer[i] << " ";
  17. }
  18. }
  19. else {
  20. std::cout<<"ne";
  21. }
  22. return 0;
  23. }