Consider the following segment of a patch I’m working on:
The analog input is connected to a momentary pushbutton with a pull-up resistor to the supply, that pulls the analog pin down to ground when the button is engaged. Digital output connected to LED pin 13 on the Arduino Redboard.
Set constants T1 and T2 both to 0.5, click “Deploy” and “Show code for Arduino.” Copy and paste transpiled code into Arduino IDE v 1.8.3. The program starts up with the LED OFF and when I push the button the analog input pin is connected to ground, boolean output of “less” goes HIGH and the LED turns on as expected while holding the button, off when the button is released.
I delete output node “OUT2” and leave the output from “greater” unconnected, as if someone has made an error… Follow the same steps to transpile code and upload via the Arduino IDE. The Arduino locks up. Then go back and undo the deletion so everything is exactly as it was before. Repeat the process again…and the Arduino still locks up. But go back into “main”, alter the values of the constants there somewhat from what they were and transpile and upload again, and for me the patch is working again as before. Doesn’t seem to matter which constant is altered, even the one not relevant to the functioning of the single digital output in this instance.
Here’s a link to a zip with the project as I have it set up:
https://www.dropbox.com/s/29qop2d9vqnt47k/hysteresisinput.zip?dl=0