добавлены комментарии по выбору пинов для разных плат. Для стартовых примеров добавлен ifdef для автоматического задания корректных выводов

This commit is contained in:
klassents committed 2025-07-29 14:26:53 +07:00
1 parent f45757f13c
commit 53511ffbe2
33 files changed
+280 -169

No files matched your search

@@ -7,7 +7,9 @@
// The DallasTemperature library can do all this work for you!
// https://github.com/milesburton/Arduino-Temperature-Control-Library
OneWire ds(10); // on pin 10 (a 4.7K resistor is necessary)
int pin = 10; // P1_4 for Start/Elsomik
OneWire ds(pin); // a 4.7K resistor is necessary on used pin
void setup(void) {
Serial.begin(9600);
@@ -12,8 +12,9 @@
* - For reading from a switch, you should use 10K pull-up resisters.
*/
OneWire net(10); // on pin 10
int pin = 10; // P1_4 for Start/Elsomik
OneWire net(pin);
void PrintBytes(const uint8_t* addr, uint8_t count, bool newline=false) {
for (uint8_t i = 0; i < count; i++) {
@@ -23,14 +23,19 @@ DS250x add-only programmable memory reader w/SKIP ROM.
*/
#include <OneWire.h>
OneWire ds(6); // OneWire bus on digital pin 6
// OneWire bus on digital pin 6
int pin = 6; // P0_2 for Start/Elsomik
OneWire ds(pin);
void setup() {
Serial.begin (9600);
}
void loop() {
byte i; // This is for the for loops
boolean present; // device present var
bool present; // device present var
byte data[32]; // container for the data from device
byte leemem[3] = { // array with the commands to initiate a read, DS250x devices expect 3 bytes to start a read: command,LSB&MSB adresses
0xF0 , 0x00 , 0x00 }; // 0xF0 is the Read Data command, followed by 00h 00h as starting address(the beginning, 0000h)