tinkerspy / Automaton

Reactive State Machine Framework for Arduino
https://github.com/tinkerspy/Automaton/wiki
MIT License
369 stars 63 forks source link

Instead of monitoring an input, can I monitor a variable? #86

Closed vatsake closed 2 years ago

vatsake commented 2 years ago

Instead of monitoring an input, can I monitor a variable?

int maxPrice = 220;
int prices[24] = { 200, 210, 230, ....};

priceController.begin()
  .IF(maxPrice, '<', prices[hour(now())])
  .led(LED_BUILTIN);

Control a LED based on this condition.