digitalWrite geht

This commit is contained in:
Tristan Krause 2019-03-29 11:50:16 +01:00
parent 15ba2f5661
commit 32cd811744
7 changed files with 6 additions and 4 deletions

View file

@ -11,6 +11,7 @@ void B15F::init()
{
std::cout << PRE << "Stelle Verbindung mit Adapter her... " << std::flush;
usart.setBaudrate(BAUDRATE);
usart.openDevice(SERIAL_DEVICE);
std::cout << "OK" << std::endl;

Binary file not shown.

View file

@ -67,7 +67,7 @@ uint8_t USART::readByte(void)
auto start = std::chrono::steady_clock::now();
auto end = start;
uint16_t elapsed = 0;
while(elapsed < timeout)
while(elapsed < timeout * 100)
{
int n_ready;
int code = ioctl(file_desc, FIONREAD, &n_ready);

Binary file not shown.

BIN
main

Binary file not shown.

View file

@ -182,10 +182,11 @@ void beispielFunktionen()
int main()
{
USART usart;
usart.openDevice("/dev/ttyUSB0");
usart.closeDevice();
beispielFunktionen();
//USART usart;
//usart.openDevice("/dev/ttyUSB0");
//usart.writeByte(5);
std::cout << "Schluss." << std::endl;

BIN
main.o

Binary file not shown.