-
Sat 2020.01.25
@Raik, is the above code in one monolithic file, as the modules file, or is there a calling page?
Is the desire to call a separate module page, or to learn how to develop a single file to develop the module code?
It's possible that L21 needs to also pass 'freq' 'time' as arguments - e.g. the function parameter list isn't present in order to pass the argument values.
Haven't tested, but thinking about it, I believe the above to be true. One could have included a console.log( freq, time ) statement within the L21 function to see if the values are 'undefined' or used the debugger.
Google to the rescue!google: passing function arguments using javascript setinterval
site:w3schools.com
See example page bottom:
Nothing to do with module development, language syntax.
Hey all, I'm trying to write my first module for the pixl and I'm having difficulties with setInterval in the modules function. I was closely following the writing modules page.
I use the code below to develop in the WebIDE. The beep function works fine, so does the second function that just calls the beep function. But then the third function involves calling beep from a setInterval. And that is not working.
What am I doing wrong?