-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneWire and Ds18B20 Temperature Sensor support #1
Comments
Thank you very much for the advice you provided, we will fully consider it |
@ksy5662 Hi. |
Hello @vkiselyov Well this one wire sensors are a pain in the a.... Unfortunately, I got no none at hand ATM to test/provide you with an example. But for the delay, I remember I used a timer. Regards, Edi |
Hi @eiten. Maybe @RAKWireless can give me some advice how to do that. |
For details. |
Next week, I should get a new RAK811 tracker board (I don't want to rip my installations out of the cars/bikes). I will test and report back. Would you like to give me your code? |
`/* The latest version of this library may be found at: OneWire has been maintained by Paul Stoffregen ([email protected]) since DO NOT EMAIL for technical support, especially not for ESP chips! Github's issue tracker for OneWire should be used only to report Back in 2010, OneWire was in need of many bug fixes, but had OneWire is now very mature code. No changes other than adding Version 2.3: Version 2.2: Version 2.1:
Version 2.0: Modifications by Paul Stoffregen, January 2010: Modified to work with larger numbers of devices - avoids loop. Updated to work with arduino-0008 and to include skip() as of Modified to calculate the 8-bit CRC directly, avoiding the need for Jim Studt's original library was modified by Josh Larios. Tom Pollard, [email protected], contributed around May 20, 2008 Permission is hereby granted, free of charge, to any person obtaining The above copyright notice and this permission notice shall be THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Much of the code was inspired by Derek Yerger's code, though I don't The CRC code was excerpted and inspired by the Dallas Semiconductor #include "OneWire.h" void directModeInput(Gpio_t *obj, PinNames pin )
} void directModeOutput(Gpio_t *obj, PinNames pin)
} void directWriteLow(Gpio_t *obj) void directWriteHigh(Gpio_t *obj) uint8_t directRead(Gpio_t *obj) void delayUS(uint32_t us) { } void ow_begin(Gpio_t obj,PinNames pin) // Perform the onewire reset function. We will wait up to 250uS for
} // //
} //
} void ow_write_bytes(const uint8_t buf, uint16_t count, uint8_t power / = 0 /) {
} //
} void ow_read_bytes(uint8_t *buf, uint16_t count) { //
} // void ow_depower() void ow_reset_search() uint8_t ow_search(uint8_t newAddr, uint8_t search_mode / = true */) unsigned char rom_byte_mask, search_direction; // initialize for search // if the last call was not the last one
} // if no device found then reset counters so next 'search' will be like a first |
`#ifndef OneWire_h #include <stdint.h> // You can exclude certain features from OneWire. In theory, this // you can exclude onewire_search by defining that to 0 // You can exclude CRC checks altogether by defining this to 0 // Select the table-lookup method of computing the 8-bit CRC // You can allow 16-bit CRC checks by defining this to 1 // Board-specific macros for direct GPIO Gpio_t *obj_int; unsigned char ROM_NO[8]; void ow_begin(Gpio_t *obj,PinNames pin);
uint8_t ow_reset(void);
void ow_select(const uint8_t rom[8]);
void ow_skip(void);
void ow_write(uint8_t v, uint8_t power); void ow_write_bytes(const uint8_t *buf, uint16_t count, uint8_t power);
uint8_t ow_read(void); void ow_read_bytes(uint8_t *buf, uint16_t count);
void ow_write_bit(uint8_t v);
uint8_t ow_read_bit(void);
void ow_depower(void); void ow_reset_search(); uint8_t ow_search(uint8_t newAddr, uint8_t search_mode / = true */); // Prevent this name from leaking into Arduino sketches #endif // OneWire_h |
`#ifndef DELAY_US_H #define NP() asm volatile("NOP"); #define DELAYN(N) for(int i = 0; i< N; i++) #endif |
I'll look over it as soon as I get the HW |
this code has many different ways of solutions in comment. |
Some news about it ? |
I need some library for OneWire and DS18B20 which is supported in Arduino.
Here are some information
https://www.pjrc.com/teensy/td_libs_OneWire.html
https://github.com/milesburton/Arduino-Temperature-Control-Library
Any Plan for supporting Arduino IDE??
Seems STmicro can be supported by Arduino.
The text was updated successfully, but these errors were encountered: