-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote.cpp
49 lines (39 loc) · 808 Bytes
/
Note.cpp
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
47
48
49
#include "Note.h"
#include <Arduino.h>
// Overloaded constructers for including next value or not
Note::Note(int value, int duration) {
_value = value;
_duration = duration;
_next = NULL;
}
Note::Note(int value, int duration, Note* next) {
_value = value;
_duration = duration;
_next = next;
}
void Note::printOut() {
char output[40];
sprintf(output, "Value = %d \t Duration = %d", _value, _duration);
Serial.println(output);
}
bool Note::hasNext() {
return _next != NULL;
}
Note* Note::getNext() {
return _next;
}
void Note::setNext(Note* next) {
_next = next;
}
int Note::getValue() {
return _value;
}
int Note::getDuration() {
return _duration;
}
void Note::setDuration(int duration) {
_duration = duration;
}
void Note::setValue(int value) {
_value = value;
}