dev: Pile of updates and formatting fixes.
This commit is contained in:
parent
47043a7869
commit
68ed9ce922
9 changed files with 182 additions and 166 deletions
30
NeoPixel.hpp
30
NeoPixel.hpp
|
|
@ -1,25 +1,29 @@
|
|||
// © 2025 A.M. Rowsell <amr@frzn.dev>
|
||||
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
// defined by the Mozilla Public License, v. 2.0.
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
// defined by the Mozilla Public License, v. 2.0.
|
||||
|
||||
#ifndef NEOPIXEL_HPP
|
||||
#define NEOPIXEL_HPP
|
||||
#include <cstdint>
|
||||
#include <xc.h>
|
||||
|
||||
class NeoPixel {
|
||||
public:
|
||||
NeoPixel(uint8_t stringLength) : length(stringLength) {};
|
||||
uint8_t setNeoPixel(uint8_t index, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void allPixelsOff(void);
|
||||
public:
|
||||
NeoPixel(uint8_t stringLength) : length(stringLength) {
|
||||
gpioPin = LATBbits.LATB9;
|
||||
};
|
||||
uint8_t setNeoPixel(uint8_t index, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void allPixelsOff(void);
|
||||
|
||||
private:
|
||||
uint8_t sendPixelData(uint8_t count, uint8_t *data);
|
||||
uint8_t PixelArray[64][3] = {{0}};
|
||||
uint8_t length;
|
||||
private:
|
||||
uint8_t sendPixelData(uint8_t count, uint8_t *data);
|
||||
uint8_t PixelArray[64][3] = {{0}};
|
||||
uint8_t length;
|
||||
volatile uint32_t gpioPin;
|
||||
};
|
||||
|
||||
#endif // NEOPIXEL_HPP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue