2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
[![Arduino CI](https://github.com/RobTillaart/Troolean/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
2021-12-29 07:05:17 -05:00
|
|
|
[![Arduino-lint](https://github.com/RobTillaart/Troolean/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Troolean/actions/workflows/arduino-lint.yml)
|
|
|
|
[![JSON check](https://github.com/RobTillaart/Troolean/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Troolean/actions/workflows/jsoncheck.yml)
|
2021-01-29 06:31:58 -05:00
|
|
|
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Troolean/blob/master/LICENSE)
|
|
|
|
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Troolean.svg?maxAge=3600)](https://github.com/RobTillaart/Troolean/releases)
|
|
|
|
|
|
|
|
|
2020-11-27 05:33:55 -05:00
|
|
|
# Troolean
|
|
|
|
|
2021-12-29 07:05:17 -05:00
|
|
|
Arduino Library for a three state logic data type supporting {True False Unknown}.
|
2020-11-27 05:33:55 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
## Description
|
2020-11-27 05:33:55 -05:00
|
|
|
|
2021-12-29 07:05:17 -05:00
|
|
|
Troolean is a data type that implements three state logic with the values
|
2020-11-27 05:33:55 -05:00
|
|
|
{True False Unknown }
|
|
|
|
|
|
|
|
Logic operators are similar to boolean and behave the same for the familiar boolean values.
|
|
|
|
|
2021-12-29 07:05:17 -05:00
|
|
|
Trooleans can be used e.g. to indicate a value is valid, invalid or unknown to be valid or not.
|
2020-11-27 05:33:55 -05:00
|
|
|
Imagine a monitoring application which has different sensors e.g. temperature. If the sensor
|
|
|
|
is sampled less than 1 minute ago one could say the value is valid, if the last sample is taken
|
|
|
|
more than an hour ago it could be changed (a lot) or not. So one does not know if the temperature
|
|
|
|
has become invalid or not. Boolean logic would make it invalid, but troolean allows to state we
|
|
|
|
just don't know. As long as there is no urgency ( a customer that needs a valid value)
|
|
|
|
one does not need to resample yet.
|
|
|
|
|
|
|
|
See also https://en.wikipedia.org/wiki/Three-valued_logic
|
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
## Interface
|
|
|
|
|
2021-12-29 07:05:17 -05:00
|
|
|
|
|
|
|
TODO
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
## Operation
|
2020-11-27 05:33:55 -05:00
|
|
|
|
|
|
|
See examples
|
|
|
|
|
2021-12-29 07:05:17 -05:00
|
|
|
|
|
|
|
## Future
|
|
|
|
|
|
|
|
- update documentation
|
|
|
|
- add unit tests (derive from test troolean.ino?)
|
|
|
|
- add examples
|
|
|
|
-
|
|
|
|
|