-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pin.cs
53 lines (39 loc) · 1.09 KB
/
Pin.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ArduinoCommunication {
class Pin {
private uint number;
private String name;
private pinMode mode;
public enum pinMode {
INPUT_PIN = 0,
OUTPUT_PIN = 1
};
public Pin(uint number, String name, pinMode mode) {
this.number = number;
this.name = name;
this.mode = mode;
}
public uint getNumber(){
return this.number;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public pinMode getMode() {
return this.mode;
}
public void setMode(pinMode mode) {
this.mode = mode;
}
public String toString() {
return "Pin #" + this.number + "," + (this.mode == pinMode.INPUT_PIN ? "input" : "output") + ", " + this.name;
}
}
}