Robert Bui / Mbed 2 deprecated CubicHand

Dependencies:   MMA8451Q Multi_WS2811 NVIC_set_all_priorities TSI cc3000_hostdriver_mbedsocket mbed

Fork of CubicHand by Model-Based Team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ledCube.h Source File

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 };