-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBadge.h
46 lines (34 loc) · 761 Bytes
/
Badge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** \file
* Constants for the Blinky Badge.
*/
#ifndef _badge_h_
#define _badge_h_
// if we are testing with feather hardware
// programing is different
//#define CONFIG_FEATHER
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <stdint.h>
#include <Wire.h>
#include "RGBMatrix.h"
#include "mma8653.h"
class Badge
{
public:
MMA8653 accel;
RGBMatrix matrix;
void begin();
// sample the accelerometers, returns true if G > 20
boolean poll();
// returns true on the rising edge of the button
boolean button_edge();
// returns true if the button is held down
boolean button();
// accelerometer measurements and smooth values
float nx, ny, nz;
float ax, ay, az, g;
private:
boolean last_button;
uint32_t last_button_millis;
};
#endif