MPU6050 teapot with other microcontrollers

edited May 2016 in Arduino

greetings !! After successfully running MPU6050 DMP Teapot Demo for Arduino, Now i want to implement the same using other microcontroller ( cypress or PIC or Renesas ). Do i need to include any other libraries for this in processing ? What should be the packet format for data to be sent from other controllers. For arduino we used ...// packet structure for InvenSense teapot demo as- uint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' }; what does each byte represent in this format ?? Thanks.

Answers

  • edited January 2017

    I guess uint8_t means unsigned char maybe? :-??

    I've just tweaked my previous "Efficient Serial ReadBytes" example from:
    https://forum.Processing.org/two/discussion/15278/processing-arduino-flexiforce#Item_3

    It's relying on Serial's buffer() & readBytes() methods in order to receive those 14 sent bytes within serialEvent():

    1. https://Processing.org/reference/libraries/serial/Serial_buffer_.html
    2. https://Processing.org/reference/libraries/serial/Serial_readBytes_.html
    3. https://Processing.org/reference/libraries/serial/serialEvent_.html

    /**
     * Efficient Serial ReadBytes (v2.0)
     * GoToLoop (2016-May-06)
     *
     * forum.Processing.org/two/discussion/16462/
     * mpu6050-teapot-with-other-microcontrollers#Item_1
     *
     * forum.Processing.org/two/discussion/17900/
     * out-of-control-y-axis-rolling-graph#Item_1
     *
     * forum.Processing.org/two/discussion/15278/processing-arduino-flexiforce
     */
    
    import processing.serial.Serial;
    
    static final int BYTES = 14, PORT_IDX = 3, BAUDS = 9600;
    final byte[] receivedBytes = new byte[BYTES];
    
    void setup() {
      noLoop();
      final String[] ports = Serial.list();
      printArray(ports);
      new Serial(this, ports[PORT_IDX], BAUDS).buffer(BYTES);
    }
    
    void draw() {
      println(receivedBytes);
    }
    
    void serialEvent(final Serial s) {
      s.readBytes(receivedBytes);
      redraw = true;
    }
    
  • dear gotoloop, Which microcontroller and sensor was used for your application. What consideration should be taken in to account while using processing environment along with other microcontroller and mpu6050. I am willing to model mpu6050's movement to processing using cypress/renesas microcontroller.

  • I don't have any of those hardware. It's completely a shot in the dark attempt. :-O

Sign In or Register to comment.