forked from blynkkk/blynk-sketch-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo
61 lines (46 loc) · 1.04 KB
/
todo
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
56
57
58
59
// Add comments
// Clean empty strings
// Review all boards available shield options filter
// Check build of platforms
const ArduinoSwSerial = {
serial_dbg: "Serial",
serial_dat: "SwSerial",
template: header_comment + `
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT <%= serial_dbg %>
<%= example.defs %>
<%= board.inc %>
<%= example.inc %>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "<%= auth %>";
#include <SoftwareSerial.h>
SoftwareSerial <%= serial_dat %>(2, 3); // RX, TX
<%= board.glob %>
<%= example.glob %>
void setup()
{
// Debug console
<%= serial_dbg %>.begin(9600);
<%= board.init %>
<%= example.init %>
}
void loop()
{
<%= board.loop %>
Blynk.run();
<%= example.loop %>
}
`
};
function getTemplate(obj) {
var c;
if (obj["template"] === undefined) {
c = ArduinoRegular;
}
if (obj["need_serial"] && obj["serial_dat"] === undefined) {
c = ArduinoSwSerial;
}
Object.assign(obj, c);
return obj.template;
}