-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOscilloscope.h
45 lines (33 loc) · 865 Bytes
/
Oscilloscope.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
// Oscilloscope.h
#ifndef OSCILLOSCOPE_H
#define OSCILLOSCOPE_H
#include "Arduino.h"
#include "Button.h"
#define NCHANNELS 1
#define BAUDRATE 115200
#define LED 13
class Oscilloscope
{
private:
bool sampling_on; //True when sampling is on
bool takeSample;
bool timeOffset_go; //First timestamp is used to remove time offset
unsigned long Time;
unsigned long timeOffSet; //Time offset (Time = millis() - timeOffset)
Button button;
int SensorReading[NCHANNELS];
const byte stop_message[2] = { 255, 253 };
const byte pause_message[2] = { 255, 254 };
const byte start_message[2] = { 255, 255 };
public:
Oscilloscope(int buttonPin);
void initializeSerial();
void checkButton();
void setTime();
void setSensorReading(int channel, int value);
void sendData();
bool getSampling_on();
void setTakeSample();
bool getTakeSample();
};
#endif