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.
Fork of MyLib by
Nunchuck/Nunchuck.h
- Committer:
- gaku_sigu
- Date:
- 2017-05-10
- Revision:
- 0:a919993ff50f
- Child:
- 3:e7a900958f54
File content as of revision 0:a919993ff50f:
#ifndef NUNCHUCK_H #define NUNCHUCK_H #include "mbed.h" #define ANALOGDATA 1 //1 : analog 0 : degital #define DEADZONE 6 //analog stick's deadzone #define ADDR 0xA4 // 0x52 << 1 class Nunchuck : I2C { public: Nunchuck(PinName SDA, PinName SCL); int8_t analogx(); int8_t analogy(); int accx(); int accy(); int accz (); bool buttonc(); bool buttonz(); private: Timer timer; bool flag; bool init(); char data[6]; void getdata(); }; #endif