/* Project: 3x3x3 Mono LED Cube (r3). * File: DisplayFrame.h * Description: Header file for DisplayFrame.cpp. * * Copyright (C) 2014 Marc Symonds * All rights reserved. * * This software may be used and redistributed, with or without * modification, as long as it is understood that this software * is provided as-is without any explicit or implied warranties * of merchantablity or fitness of purpose. */ #ifndef DisplayFrame_h #define DisplayFrame_h #include "Arduino.h" typedef byte (*POSTransFPtr)(byte, byte, byte); byte POSTrans0(byte, byte, byte); byte POSTrans1(byte, byte, byte); byte POSTrans2(byte, byte, byte); byte POSTrans3(byte, byte, byte); byte POSTrans4(byte, byte, byte); byte POSTrans5(byte, byte, byte); byte POSTrans6(byte, byte, byte); byte POSTrans7(byte, byte, byte); POSTransFPtr GetPOSTrans(byte); #define POS(x, y , z) (((y)*9)+((x)*3)+(z)) struct DisplayParameters { public: byte subFrame; byte subFrameBit; byte x; DisplayParameters() : subFrame(0), subFrameBit(1), x(0) {}; }; struct Point { public: byte x; byte y; byte z; Point() : x(0), y(0), z(0) {}; Point(byte a, byte b, byte c) : x(a), y(b), z(c) {}; void Set(byte a, byte b, byte c) { x = a; y = b; z = c; } byte Pos() { return POS(x, y, z); } }; class Light { public: byte speed; boolean up; unsigned long t; }; const byte MAXBRIGHTNESSLEVEL = 7; extern byte displayFrame[27]; extern Point points[8]; //extern const byte brightnessSubFrames[8]; typedef boolean (*df_processAllFunc)(int *, byte); void df_init(); void updateDisplay(); void df_allOn(); void df_clear(); boolean df_fadeOut(int = 50); boolean df_processAll(df_processAllFunc, int *); void df_DisplayMonoFrame(POSTransFPtr, unsigned long); #endif
Recent Comments