Hello,
I am fairly new to c++ and am trying to code a FRDM mbed board. My question is how do I define the variable period, and frequency for that matter, to be used outside of my while loop?
I don't know the volatile keyword, but you have both variables as global variables, so they should work in the loop. You have a lot of code outside of your main, is that where it's supposed to be?