- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpiFile.cpp
More file actions
Latest commit
54 lines (42 loc) · 845 Bytes
/
Copy pathpiFile.cpp
File metadata and controls
54 lines (42 loc) · 845 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include<wiringPi.h>
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
usingnamespacestd;
classPi {
public:
Pi();
Pi(string message);
//void blink(int delay);
voidtransmit(unsignedint delay, bool state);
voidtransmit2(unsignedint delay, bool state);
};
voidblink(int del) {
for (int i = 0; i < 10; i++) {
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
}
}
voidPi::transmit(unsignedint del, bool state) {
digitalWrite(0, 0;
delay(del);
digitalWrite(0, state);
delay(del);
}
Pi::Pi() {
wiringPiSetup();
pinMode(0, OUTPUT);
}
/*
int main() {
wiringPiSetup();
pinMode(0, OUTPUT);
Pi pi;
cout<<"lol";
return 0;
}
*/