You are reading a single comment by @bertjerred and its replies.
Click here to read the full conversation.
-
Sat 2021.09.25
I wanted to use an ADC (potentiometer) to alter PWM in realtime while the note is playing continuously, could I?
Code snippets:
http://www.espruino.com/Software+PWM
http://www.espruino.com/ADC
found at
http://www.espruino.com/Tutorials
Keeping it short so you can:post #28 'go try to build build build . . . '
Wow, thank you. So many things here for me to digest. As always, please forgive my lack of experience, but 1) these are functions within a function... each assigned to 1-bit changes? Is that right? and 2) Espruino (and JavaScript) interpret 'on the fly,' so to speak?
And 3) if I was using, say, a polling version for MPR121 key strokes successfully (e.g., I can play a C# for as long as I hold down the appropriate key), and I wanted to use an ADC (potentiometer) to alter PWM in realtime while the note is playing continuously, could I?
I'm not sure I fully understand the order in which the code gets interpreted by the Espruino, and therefore where to embed my "mod wheel" potentiometer loop. Or maybe I just get confused by loops within loops...
In any case, I sure do appreciate all of this, @allObjects!