![]() Useful for determining if we should call receive_read() (if is_read_poll() returns true) //or receive_cmd() if is_read_poll() returns false) float get_last_received_reading() function to see if issued_read() was set. gets the read response from the device, and parses it into the reading variable //if send_read() wasn't used to send the "R" command and issued_read() isnt set, the function will //return the "NOT_READ_CMD" error bool is_read_poll() We recommand 32 bytes/chars as a default enum errors receive_read_cmd() Buffer should be long enough to hold the longest command //you'll receive. ![]() receive the devices response data into a buffer you supply. sends the "RT" command with the temperature converted to a string //to the device and sets issued_read() to true, //so we know to parse the data when we receive it with receive_read() enum errors receive_cmd( char* sensordata_buffer, uint8_t buffer_len) PH.send_cmd_with_num("T,", 25.0) will send "T,25.000" void send_read_with_temp_comp( float temperature) sends any command with the number appended as a string afterwards. sends the "R" command to the device and sets issued_read() to true, //so we know to parse the data when we receive it with receive_read() void send_cmd_with_num( const char* cmd, float num, uint8_t decimal_amount = 3) send any command in a string, see the devices datasheet for available i2c commands void send_read_cmd() Takes I2C address of the device //as well a name of your choice Ezo_board( uint8_t address, TwoWire* wire) //Takes I2C address and TwoWire interface Ezo_board( uint8_t address, const char* name, TwoWire* wire) //Takes all 3 parameters void send_cmd( const char* command) constructors Ezo_board( uint8_t address) //Takes I2C address of the device Ezo_board( uint8_t address, const char* name)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |