-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticle device code
More file actions
55 lines (36 loc) · 869 Bytes
/
Copy pathParticle device code
File metadata and controls
55 lines (36 loc) · 869 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
55
//declare pins
int ledRed = D3;
int ledBlue = D4;
void setup() {
pinMode(ledRed, OUTPUT);
digitalWrite(ledRed, LOW);
pinMode(ledBlue, OUTPUT);
digitalWrite(ledBlue, LOW);
// exposing the 2 function to the cloud
Particle.function("blue", Blue);
Particle.function("red", Red);
}
// function for the blue LED
int Blue(String test){
digitalWrite(ledBlue, HIGH);
delay(1000);
digitalWrite(ledBlue, LOW);
delay(1000);
digitalWrite(ledBlue, HIGH);
delay(1000);
digitalWrite(ledBlue, LOW);
return 0;
}
// function for the red LED
int Red(String test){
digitalWrite(ledRed, HIGH);
delay(1000);
digitalWrite(ledRed, LOW);
delay(1000);
digitalWrite(ledRed, HIGH);
delay(1000);
digitalWrite(ledRed, LOW);
return 0;
}
void loop() {
}