diff --git a/readme.MD b/readme.MD index 6d03c4c..9b6bdf4 100644 --- a/readme.MD +++ b/readme.MD @@ -8,6 +8,17 @@ A simple driver written for libopencm3 and stm32f0, it was written from first pr * It uses `NOP` for some of its timing which is probably not ideal * The timings are rough, it could need some optimisation (but works with the fake ds18b20s I have.) +## Example Usage + +``` +#include "ds18b20.h" + +//Get Data from DS18b20 Sensor 1 +ds18b20_start_conversion(GPIOB, GPIO1); +// Wait for conversion to complete +delay_ms(750); +int16_t ds_temp = ds18b20_read_raw_temperature(GPIOB, GPIO1); +``` ## References * https://teslabs.com/openplayer/docs/docs/other/ds18b20_pre1.pdf * https://www.circuitbread.com/tutorials/embedded-c-programming-with-the-pic18f14k50-12-digital-thermometer