|
constexpr uint8_t | pin_onewire { 8 } |
|
constexpr uint8_t | pin_led { 13 } |
|
constexpr uint8_t | pin_button { 2 } |
|
uint8_t | mem_read [16] |
|
uint8_t | display_mode = 0 |
|
uint8_t | mem_buffer [144] |
|
unsigned long | EEPROM_lPowerCount0 |
|
unsigned long | EEPROM_lPowerCount1 |
|
unsigned long | time_last_update |
|
auto | hub = OneWireHub(pin_onewire) |
|
auto | ds2433 = DS2433(DS2433::family_code, 0x00, 0x00, 0x33, 0x24, 0xDA, 0x00) |
|
auto | ds18b0 = DS18B20(0x28, 0x00, 0x00, 0x33, 0x24, 0xDA, 0x00) |
|
auto | ds18b1 = DS18B20(0x28, 0x01, 0x00, 0x33, 0x24, 0xDA, 0x00) |
|
Code that emulates a 1wire LCD/OLED Display (DS2433 4096 bits EEPROM)
- Author
- drtrigon
- Date
- 2018-06-21
- Version
- 1.1
-
1.0
- add supply voltage and chip temperature sensors
- first version providing all basic features
- See Also
- http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22
-
http://www.seeedstudio.com/wiki/File:Stem-diagram-sign.jpg
-
http://www.instructables.com/id/Arduino-1-wire-Display-144-Chars/
* OneWireHub library compilation for v2.2.0:
* Needs for compilation Arduino IDE version >= 1.8.3 due to used syntax.
* OneWireHub library settings for v2.2.0:
* In order to make OneWireHub library v2.2.0 work properly with my 1wire network
* (Raspberry Pi Server with iButton LinkHub-E) I need to adopt
* 'libraries/OneWireHub/OneWireHub_config.h':
* constexpr timeOW_t ONEWIRE_TIME_MSG_HIGH_TIMEOUT = { 150000_us };
* this is 10x the default value (may be smaller works too).
* @see https://github.com/orgua/OneWireHub/issues/43
* Optionally we can also change
* 'libraries/OneWireHub/OneWireHub_config.h':
* #define HUB_SLAVE_LIMIT 8
* as we need only 3 slots and the lower the value the faster are responses.
* These settings might cause issues with other sketches - be aware of that.
*
* Pinout:
* OLED (Grove Shield I2C/Wire):
* 1: GND black -> Arduino GND
* 2: VCC red -> Arduino 5V
* 3: SDA white -> Arduino Pin A4
* 4: SCL yellow -> Arduino Pin A5
* Status LED:
* STATUS LED -> Arduino Pin D13
* -> Arduino GND via 4.7k resistor eg.
* Control Buttons or Switch:
* RESET BTN -> Arduino Pin RST
* -> Arduino GND
* LCD MODE BTN -> Arduino Pin D2 (internal pullup enabled)
* -> Arduino GND
* 1wire data bus (MicroLAN):
* 1WIRE DATA -> Arduino Pin D8
*
* Test on Raspberry Pi Server using OWFS (owshell):
* $ /opt/owfs/bin/owwrite 2D.00003124DA00/memory 'hello world!'
* $ /opt/owfs/bin/owget 2D.00003124DA00/memory
*
* Tested with:
* - 1wire LCD/OLED Display:
* LinkHubE-Master, atmega328@16MHz (Arduino Uno) as Slave
* - OneWire HubDS2433 4096 bits EEPROM:
* DS9490R-Master, atmega328@16MHz and teensy3.2@96MHz as Slave
*
* Thanks to:
* orgua - OneWireHub OneWire slave device emulator
* @see https://github.com/orgua/OneWireHub
*