Skip to content

Instantly share code, notes, and snippets.

// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
const int MPU=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
Wire.begin();
Wire.beginTransmission(MPU);
@adielfernandez
adielfernandez / OFtoArduino
Last active March 10, 2018 23:29
Arduino serial string parsing (from OF string sending)
//This code is for sending data from OpenFrameworks to Arduino. This will package 3 values for the arduino
//to read as a string. This code supports values from -2,147,483,648 to 2,147,483,647, not just 0-255!
//(since we're storing them on the arduino side as long variables)
//------------------------------OpenFrameworks string sending------------------------------
//The code below will send the values 12345, 0 and 255.
//----------in header file----------