Arduino to Squirrel

Essentially:

‘void’ becomes ‘function’
‘double’, ‘bool’, ‘unsigned long’ and ‘int’ become ‘local’
#define’ becomes ‘const’.

These are not literal translations, but if you change your code accordingly, you’re most of the way there.

Also, this code contains functions but not entry point, so you’ll need some code to trigger SetMode() to be run (since it calls Initialize() )

One more thing: the working variables at the start need to be marked as global, ie.

‘double Input, Output, Setpoint;’ becomes
’Input <- 0;

Output <- 0;

Setpoint <- 0;’

PS. Don’t know why the <br/ > are showing up there, but ignore them