You need to use promises. There was a discussion thread about this but I cant find it right now.
the functions at line 107 and 129 demonstrate how to chain them together.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Have a look at gpssetup.
https://github.com/espruino/BangleApps/blob/master/apps/gpssetup/gpssetup.js
You need to use promises. There was a discussion thread about this but I cant find it right now.
the functions at line 107 and 129 demonstrate how to chain them together.