Page 1 of 1

Setting Arduino Flowcode Sleep Wake functionality

Posted: Mon Mar 20, 2023 2:13 pm
by canary_wharfe
The attached old Flowcode 5 example is a tutorial Ben wrote way back in time illustrating the code used to put a PIC micro to sleep and wake it up.
I am trying to learn how applicable the syntax of that 'c' statement in the Flowchat is if we want to put an AVR or an Arduino to sleep.

On reviewing online tips on how to put an Arduino to sleep it appears most people use the low power sleep library 'sleep.h'.
The process seems to be, enable the sleep mode, then set the sleep mode (e.g. full sleep) and finally activating sleep with something like
sleep_cpu (); // using a previously defined sleep function.

The wake function follows the usual triggering an interrupt having previously enabled interrupts before going to sleep. The Uno and the Pro Mini have 2 pins (d2 and d3) that have the capability to interrupt what the Arduino is doing.

So my question is can someone give me a Flowcode example with the syntax of the c icons where applicable for 'sleeping' and 'waking' an Arduino with Flowcode? Is it as simple as the encs. example Ben gave us in Flowcode 5 or do we have to cater specifically for the way Flowcode's API works with the Arduino? I have never used the sleep function before on any micro so I'm once again back on the learning curve!

As always many thanks in advance.