Skip to content

Commit cfaaee3

Browse files
committed
Refactoring
1 parent ade7827 commit cfaaee3

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The OWI library has been developed to support the implementation of
66

77
* [Abstract One-Wire Interface, OWI](./src/OWI.h)
88
* [Software One-Wire Interface, Software::OWI](./src/Software/OWI.h)
9-
* [Programmable Resolution 1-Wire Digital Thermometer, DS18B20](./src/DS18B20.h)
9+
* [Programmable Resolution 1-Wire Digital Thermometer, DS18B20](./src/Driver/DS18B20.h)
1010

1111
## Example Sketches
1212

examples/DS18B20/DS18B20.ino

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
#include "OWI.h"
21
#include "GPIO.h"
2+
#include "OWI.h"
33
#include "Software/OWI.h"
4-
#include "DS18B20.h"
4+
#include "Driver/DS18B20.h"
55

6+
#if defined(ARDUINO_attiny)
7+
#include "Software/Serial.h"
8+
Software::Serial<BOARD::D0> Serial;
9+
Software::OWI<BOARD::D1> owi;
10+
#else
611
Software::OWI<BOARD::D7> owi;
12+
#endif
13+
714
DS18B20 sensor(owi);
815

916
void setup()

examples/DS1990A/DS1990A.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ const uint8_t KEY[] PROGMEM = {
99
0x01, 0x26, 0xd9, 0x3e, 0x09, 0x00, 0x00, 0x47
1010
};
1111

12-
// One-Wire bus manager
13-
Software::OWI<BOARD::D7> owi;
14-
15-
// Use built-in LED to signal
12+
#if defined(ARDUINO_attiny)
13+
GPIO<BOARD::D0> led;
14+
Software::OWI<BOARD::D1> owi;
15+
#else
1616
GPIO<BOARD::D13> led;
17+
Software::OWI<BOARD::D7> owi;
18+
#endif
1719

1820
void setup()
1921
{

examples/Scanner/Scanner.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
#include "GPIO.h"
33
#include "Software/OWI.h"
44

5+
#if defined(ARDUINO_attiny)
6+
#include "Software/Serial.h"
7+
Software::Serial<BOARD::D0> Serial;
8+
Software::OWI<BOARD::D1> owi;
9+
#else
510
Software::OWI<BOARD::D7> owi;
11+
#endif
612

713
void setup()
814
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=OWI
2-
version=1.1
2+
version=1.2
33
author=Mikael Patel
44
maintainer=Mikael Patel <mikael.patel@gmail.com>
55
sentence=One-Wire Interface (OWI) library for Arduino.

src/DS18B20.h renamed to src/Driver/DS18B20.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file DS18B20.h
2+
* @file Driver/DS18B20.h
33
* @version 1.0
44
*
55
* @section License

0 commit comments

Comments
 (0)