• 3DMouse8adrainB.js

    This version uses the update BNO055.js module from the WebIDE sandbox.
    It requires BNO055.js (sandbox), FlashEEPROM, and ESP8266WiFi_0v25 (Espruino modules).
    It runs on a PICO with an ESP8266 connected via a shim.
    The BNO055 module is connected as before.
    // define the I2C connection I2C3.setup({ scl :A8, sda: B4} );
    A normally open pushbutton is connected to ground and pin B7. Once the calibration status read 3333 the button is pressed to write the calibrations to the PICO EEROM
    The calibration offsets and radiae are saved in PICO EEROM page var CalPage=89;
    The html page is divided into two portions page1 and page2 to avoid out of memory errors
    The web address uses port 8000. Given a router assigned IP address 192.168.1.6 use
    "http//192.168.1.6:8000" in the browser. (Note older browsers may noe support the WebSockets used in this program. ( My old Android Tablet loads the page but doesn't support the websockets)
    The drain command is used to serve the two pages.

    function onPageRequest(req, res) {
      res.writeHead(200, {'Content-Type': 'text/html'});
     res.on('drain',function(){
      res.write(page2);
      res.end();//Page);
     });
      res.write(page1);
    }
    

    Some sample left pane output:

    A
    {"st":333,"yaw":341.125,"roll":16.625,"p­itch":101.3125}
    Usage= 4369
    A
    {"st":333,"yaw":341.0625,"roll":16.4375,­"pitch":101.5}
    Usage= 4369
    

    The BNO055.js module and savCalBNO055.js can be found at:
    http://forum.espruino.com/conversations/­305928/


    4 Attachments

About