Good Evening Monks!
I have a light sensor and I need to capture a numeric range from the serial monitor to which I've already done commands using simple letter matches. Number matches I am completely lost with outside of the normal $data == 5 (do something) and so on. I need to capture a range of 200-300 and 400-500 so I can issue a command based on any number within that range. For example:
if ($range ==/300-400/) { exit; } if ($range == /425-500/) { print STDOUT "LIGHTS ON"\n; }
In reply to Match Numeric Range by PilotinControl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |