Good Day all!
Happy New Years!!
Ok, I’m trying to communicate to a serial sensor via TX and RX. I can send a query to the sensor, I can see on the sensor Led display it’s received a request. I can see the sensor send the response, but the WiFi kit8 never receives it.
Do I have to define the Pins for TX and RX on the WiFi Kit8 ?
If so, can a Understandable Sample be shown?
I’m defining “mdDeRe D7” as output, is this the correct way?
I don’t see pin D7 turn LOW at all.
Maybe this is the reason we are not getting RX data.
This is what I’m sending:
#define mdDeRe D7 // D7/GPIO13 sends signal to Sensor to receive or send Data.
int incomingByte[13] ; //array of data
#include <U8g2lib.h>
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=/ 16, / clock=/ 5, / data=*/ 4);
void setup() {
pinMode (mdDeRe,OUTPUT);
Serial.begin(9600);
u8g2.begin();
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_ncenB12_tr);
u8g2.drawStr(25,15,“Loading…”);
u8g2.sendBuffer(); // transfer internal memory to the display
delay(3000);
void loop() {
digitalWrite(mdDeRe, HIGH);
Serial.write(17);
Serial.write(3);
Serial.write(0);
Serial.write(84);
Serial.write(0);
Serial.write(4);
Serial.write(7);
Serial.write(73);
Serial.flush();
digitalWrite(mdDeRe,LOW);
if (Serial.available()) {
for (int i=0; i<13; i ++){
incomingByte[i] = Serial.read();
}
}
int Temp = incomingByte[4];
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr);
u8g2.drawStr(10,8,"Sensor GTemp is: ");
u8g2.drawStr(35,19,Temp);
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
while(Serial.available() >0){
byte dump = Serial.read();
}