Initial version of refactored stm demo code for current measurement