@kierankay, hat's a tough task you take onto you... the way that Arduino works - polling loop - versus Espruino - interrupt driven - puts itself in way of adapting this code. Furthermore, check on the implementation of Promises in Arduino world. Depending what the adafruit libs give you (setting some flags on filtered reception of data and buffer thereof) and availability of a lib or your on implementation of Promises you should be able to lean on the main line and structure of the Espruino code...
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.
@kierankay, hat's a tough task you take onto you... the way that Arduino works - polling loop - versus Espruino - interrupt driven - puts itself in way of adapting this code. Furthermore, check on the implementation of Promises in Arduino world. Depending what the adafruit libs give you (setting some flags on filtered reception of data and buffer thereof) and availability of a lib or your on implementation of Promises you should be able to lean on the main line and structure of the Espruino code...