// Program for esp32 to read data sent by attiny1614 via uart // created by Jans Hendry // Universitas Gadjah Mada, Indonesia // Kamakura Node, Japan // fab academy MIT - 2022 char temp[100]; // temporary variable int inc = 0; // incrementation value const int RX2 = 16; // second RX of UART const int TX2 = 17; // second TX of UART void setup(){ Serial.begin(9600); // first serial to see result in monitor Serial2.begin(9600, SERIAL_8N1, RX2, TX2); // second serial for device communication } void loop(){ while(Serial2.available()){ char sdt = char(Serial2.read()); // read from serial the character Serial.print(sdt); // directly display the read out temp[inc] = sdt; // store value one by one inc += 1; // increment if (sdt == '\0'){ Serial.println(""); inc = 0; // reset increment value } } }