• Introduction

    Having developed an Espruino module for the BNO055 IMU chip, this project will attempt to use the Euler angle of Yaw, Pitch and Roll that the chip provides to position a video rendering of an airplane on the computer screen. It is intended that as the orientation of the BNO055 chip is changed that the airplane image on the screen will follow.
    http://forum.espruino.com/conversations/­305928/

    Implementation

    The progress so far serves a webpage that display the airplane and HTMP post commands obtain updated Euler angles that the PICO increments. Integration with the BNO055, will follow in a few days.
    A PICO with an ESP8266 attached by a shim is the platform. The BNO055 IMU chip is also connected to the PICO.

    The attached files

    Flight4.html contains the web page that will display the airplane, but it is set to simulate the changes of the Euler angles. If opened in a browser, it demonstrates the airplane in motion.
    Flight4a.html is similar to flight4.html but is set to use HTML Post messages to the server to obtain the Euler angles.
    Jnet.js is the Web credentials file that you will need to edit and place in the WebIDE projects module subdirectory. Edit the ssid and pw for your local wifi network.

    /* Jnet.js */
    exports = { id: "...", ssid: "funny", pw: "1234567890", ip: "..." 
    

    ServePage3a.js contains the server code. It connects to the WiFi using jnet.js credentials.
    It displays the IP address that you will use to access via a browser.

    1v92 Copyright 2016 G.Williams
    >Start
    Start connection process
    Try again
    =undefined
    Reset the ESP8266
    Connecting to WiFi
    IP=  192.168.1.6
    null
    Wi-Fi Connected
    

    Once a browser connects you will see:

    1v92 Copyright 2016 G.Williams
    >Start
    Start connection process
    Try again
    =undefined
    Reset the ESP8266
    Connecting to WiFi
    IP=  192.168.1.6
    null
    Wi-Fi Connected
    {"st":3333,"yaw":0,"roll":10,"pitch":0}
    A
    {"st":3333,"yaw":0,"roll":20,"pitch":0}
    A
    {"st":3333,"yaw":0,"roll":30,"pitch":0}
    A
    {"st":3333,"yaw":0,"roll":40,"pitch":0}
    A
    {"st":3333,"yaw":0,"roll":50,"pitch":0}
    

    Screenshot1.jpg shows a screenshot of the webpage.

    Future work

    1. Use six switches, two for each axis. If a switch is closed increment or decrement the angle
    2. Use 3 potentiometers two in a joystick and one for the rudder , use the values read by an analog port to increment or decrement the Euler angles.
    3. Write the code to uses the BNO055 module to change the Euler angles.

      Msg.roll+=10;
      if(Msg.roll>360){
      Msg.roll=0;
      Msg.yaw+=45;
      if(Msg.yaw>360){
      Msg.yaw=0;
      Msg.pitch+=15;if(Msg.pitch>360)Msg.pitch­=0;
      }//endif yaw
      }//endif roll
      var M=JSON.stringify(Msg);
      console.log(M);
      res.writeHead(200, {'Content-Type': 'text/plain','Content-length':M.length})­;
      //res.writeHead(200);
      res.end(M);
      

    5 Attachments

About