-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeating.h
More file actions
34 lines (28 loc) · 680 Bytes
/
Heating.h
File metadata and controls
34 lines (28 loc) · 680 Bytes
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
/*
* Project: ReflowOven
* File: Heating.h
* Author: Sandro Lutz
*/
#ifndef HEATING
#define HEATING
#include <Arduino.h>
#include <avr/interrupt.h>
extern "C" void TIMER2_COMP_vect(void) __attribute__ ((signal));
class Heating
{
friend void TIMER2_COMP_vect(void);
public:
static const uint8_t MAX_POWER = 5;
void attach(int pin);
void increasePower();
void decreasePower();
void setPower(uint8_t power); // allowed interval is [0, 5]
uint8_t getPower();
protected:
int pin;
uint8_t power;
uint8_t counter;
uint8_t cc; // correction counter because OCR2 should ideally be 156.25
};
extern Heating heating;
#endif