-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelper.cpp
More file actions
32 lines (25 loc) · 738 Bytes
/
Helper.cpp
File metadata and controls
32 lines (25 loc) · 738 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
#include "Arduino.h"
#include <Helper.h>
void Helper::digitalWrites(uint8_t pins[], uint8_t val)
{
uint8_t arrSize = sizeof(pins) / sizeof(pins[0]);
for (int i = 0; i < arrSize; i++)
digitalWrite(pins[i], val);
}
void Helper::pinModes(uint8_t pins[], uint8_t mode)
{
uint8_t arrSize = sizeof(pins) / sizeof(pins[0]);
for (int i = 0; i < arrSize; i++)
pinMode(pins[i], mode);
}
void Helper::plot(String label, float value, bool isLastGraph = false)
{
Serial.print(label); // May be empty string
if (label != "")
Serial.print(": ");
Serial.print(value);
if (isLastGraph == false)
Serial.print(", ");
else
Serial.println();
}