DCC-EX / dcc-ex.github.io

The DCC-EX website, written in reStructuredText, generated using sphinx, and served by GitHub pages.
https://dcc-ex.com
GNU General Public License v3.0
12 stars 32 forks source link

[Documentation Update]: LATCH/UNLATCH explanation #541

Open peteGSX opened 1 year ago

peteGSX commented 1 year ago

Documentation details

This is worth capturing somwehere (from the EX-RAIL master):

Latch/unlatch is staggeringly simple... There are 256 latches (64 on a Uno) A latch can be LATCHed or UNLATCHed.

When exrail checks a sensor with IF , AT, AFTER etc it will first check the latch and if the latch is latched it will return true for the sensor without checking the hardware. This was originally designed to latch a pushbutton without having to deal with debouncing etc... hence the name.

The clever bit ... If you test a sensor pin that does not exist then it returns false, unless of course it is latched! So a latch is a very convenient way of setting a flag that can be tested later..... now you have the building block to play with.

Page with issues

No response

FrightRisk commented 5 months ago

This is GREAT documentation! Captures the spirit of the DCC-EX "style" and very clear and concise.