-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlash.h
More file actions
34 lines (27 loc) · 901 Bytes
/
Flash.h
File metadata and controls
34 lines (27 loc) · 901 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
/*-------------------------------------------------------------------------
This source file is a part of Clover
For the latest info, see https://github.com/cmarrin/Clover
Copyright (c) 2021-2022, Chris Marrin
All rights reserved.
Use of this source code is governed by the MIT license that can be
found in the LICENSE file.
-------------------------------------------------------------------------*/
// Flash Class
//
// This class flashes the lights a given number of times (for error output)
#pragma once
#include "NeoPixel.h"
#include <stdint.h>
class Flash
{
public:
bool init(mil::NeoPixel* pixels, uint8_t h, uint8_t s, uint8_t v, uint8_t count, uint16_t duration);
int32_t loop(mil::NeoPixel* pixels);
private:
uint32_t _color;
uint8_t _count;
uint16_t _duration; // in ms
uint32_t _lastFlash = 0;
bool _on = false;
uint8_t _countCompleted = 0;
};