Next go to line 312 and add in the following lines or copy paste from the code below:
The function defines the first parameter as sensor data, second as the message format to be printed, third and fourth as the LCD display cursor and fifth as the clear display parameter
|
After we have defined our print sensor data on LCD function, we will navigate to the SendTxData function and go to line 535. We will add in the following to print the sensor data on the LCD display.
As defined by the function earlier, the 5 parameters are stated every time we call the function. For example, the first parameter of LCDPrintData(pressure, "%dhPa", 0, 0, true) is the pressure sensor data, second is the formatted string of text to be printed on the LCD, third & fourth sets the cursor of the LCD to print on the first row & column of the display and fifth is a boolean type where true means that the display will be cleared.
/* Murata - Printing Tx sensor readings on LCD Display */
LCDPrintData(pressure, "%dhPa", 0, 0, true);
LCDPrintData(temperature, "%d^C", 9, 0, false);
LCDPrintData(humidity, "%d%%Hum", 0, 1, false);
LCDPrintData(light, "%d lux", 9, 1, false);
|
Finally, rebuild the files, load it into the 1SJ board and press the reset button. The LCD Display should be showing your sensor data as seen below.