Closed srkmurd closed 6 years ago
Hi,
This is a library for a VL53L0X distance sensor, and the GitHub issues are intended for tracking bugs and feature requests related to the library code. It doesn't look like you are using this library (I don't see any mention of the VL53L0X in your code), so this is not the right place for your question.
I would suggest asking for help either from the manufacturer of your sensor boards or from a more general community like the Arduino forum.
Kevin
I am trying to read from these sensors but only 1 sensor's reading is coming on the serial monitor on sending the 'R' character. the code is `#include //enable I2C.
define address 97 //default I2C ID number for EZO D.O. Circuit.
define address_pH 99 //default I2C ID number for EZO pH Circuit.
char computerdata[20]; //we make a 20 byte character array to hold incoming data from a pc/mac/other. byte received_from_computer = 0; //we need to know how many characters have been received. byte code = 0; //used to hold the I2C response code. char DO_data[20]; //we make a 20 byte character array to hold incoming data from the D.O. circuit. byte inchar = 0; //used as a 1 byte buffer to store inbound bytes from the D.O. Circuit. int time = 900; //used to change the delay needed depending on the command sent to the EZO Class D.O. Circuit. float DO_float; //float var used to hold the float value of the DO. char DO; //char pointer used in string parsing. char sat; //char pointer used in string parsing. float do_float; //float var used to hold the float value of the dissolved oxygen. float sat_float; //float var used to hold the float value of the saturation percentage.
char computerdata_pH[20]; //we make a 20 byte character array to hold incoming data from a pc/mac/other. byte received_from_computer_pH = 0; //we need to know how many characters have been received. byte code_pH = 0; //used to hold the I2C response code_pH. char pH_data[20]; //we make a 20-byte character array to hold incoming data from the pH circuit. byte in_char_pH = 0; //used as a 1 byte buffer to store inbound bytes from the pH Circuit. byte i = 0; //counter used for ph_data array. int time_pH = 900; //used to change the delay needed depending on the command sent to the EZO Class pH Circuit. float ph_float; //float var used to hold the float value of the pH.
void setup() //hardware initialization. { Serial.begin(9600); //enable serial port. Wire.begin(); //enable I2C port. }
void loop() { //the main loop. byte i = 0; //counter used for DO_data array.
if (Serial.available() > 0) { //if data is holding in the serial buffer received_from_computer = Serial.readBytesUntil(13, computerdata, 20); //we read the data sent from the serial monitor(pc/mac/other) until we see a. We also count how many characters have been received.
computerdata[received_fromcomputer] = 0; //stop the buffer from transmitting leftovers or garbage.
/ computerdata[0] = tolower(computerdata[0]); //we make sure the first char in the string is lower case./
if (computerdata[0] == 'c' || computerdata[0] == 'r')time = 900; //if a command has been sent to calibrate or take a reading we wait 600ms so that the circuit has time to take the reading.
else time_ = 300; //if not 300ms will do
}
} void string_pars() { //this function will break up the CSV string into its 2 individual parts, DO and %sat. byte flag = 0; //this is used to indicate is a “,” was found in the string array byte i = 0; //counter used for DO_data array.
}` only 1 sensor ,dissolved oxygen sensor is able to respond as can also be seen on the green led blink on the sensor. can you please help on this issue.?