Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Accelerometer.h
00001 #pragma once 00002 #include "mbed.h" 00003 00004 #include "Color565.h" 00005 #include "LCD_ST7735.h" 00006 00007 class Accelerometer 00008 { 00009 public: 00010 Accelerometer(int nI2cAddress, LCD_ST7735* pDisp); 00011 void getXYZ(double& x, double& y, double& z); 00012 void resetGraph(); 00013 void updateGraph(); 00014 00015 private: 00016 static const int GRAPH_HEIGHT = 40; 00017 static const int GRAPH_SPACING = 2; 00018 00019 void readRegisters(char address, char* buffer, int len); 00020 int writeRegister(char address, char value); 00021 double convert(char* buffer); 00022 00023 int i2cAddress; 00024 I2C i2c; 00025 LCD_ST7735* pDisp; 00026 unsigned short colors[3]; 00027 int graphX; 00028 00029 void drawAxes(); 00030 void drawPoint(int axis, double value); 00031 void checkGraphReset(); 00032 };
Generated on Thu Jul 14 2022 10:55:45 by
1.7.2