Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MMA8451Q Multi_WS2811 NVIC_set_all_priorities TSI cc3000_hostdriver_mbedsocket mbed
Fork of CubicHand by
ledCube.h
00001 #include "mbed.h" 00002 #include "WS2811.h" 00003 00004 #pragma once 00005 00006 class LedCube 00007 { 00008 public: 00009 LedCube(); 00010 ~LedCube(); 00011 void Init(int x, int y, int z); 00012 int getLedIndex(int panel, int x, int y); 00013 void updateLEDs(bool on, int size, int x, int y, int z); 00014 void updateLEDsOld(bool on, int size, int x, int y, int z); 00015 void cubeUpdate(); 00016 void UpdateCube(int size, int deltaX, int deltaY, int deltaZ, float hue); 00017 int move(int deltaX, int deltaY, int deltaZ); 00018 void changeColor(float hue); 00019 void changeSize(int newSize); 00020 00021 private: 00022 unsigned const X; 00023 unsigned const Y; 00024 unsigned const Z; 00025 int pos[3]; 00026 int prevPos[3]; 00027 int size; 00028 int prevSize; 00029 00030 float saturation; 00031 float brightness; 00032 uint8_t r; 00033 uint8_t g; 00034 uint8_t b; 00035 WS2811 ledStrip1; 00036 WS2811 ledStrip2; 00037 00038 };
Generated on Tue Jul 12 2022 21:52:20 by
1.7.2
