Skip to content

Commit

Permalink
added firmware to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lookingGlassFactory committed May 29, 2017
1 parent 9e40283 commit 8f8869f
Show file tree
Hide file tree
Showing 43 changed files with 5,295 additions and 139,665 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1,040 changes: 1,040 additions & 0 deletions 16x16x16 cube/firmware/source.ino

Large diffs are not rendered by default.

33,457 changes: 0 additions & 33,457 deletions 8x8x8 cube/Base Board.b#1

This file was deleted.

33,454 changes: 0 additions & 33,454 deletions 8x8x8 cube/Base Board.b#2

This file was deleted.

9,646 changes: 0 additions & 9,646 deletions 8x8x8 cube/Base Board.s##

This file was deleted.

9,646 changes: 0 additions & 9,646 deletions 8x8x8 cube/Base Board.s#1

This file was deleted.

9,646 changes: 0 additions & 9,646 deletions 8x8x8 cube/Base Board.s#2

This file was deleted.

9,645 changes: 0 additions & 9,645 deletions 8x8x8 cube/Base Board.s#3

This file was deleted.

9,642 changes: 0 additions & 9,642 deletions 8x8x8 cube/Base Board.s#4

This file was deleted.

9,642 changes: 0 additions & 9,642 deletions 8x8x8 cube/Base Board.s#5

This file was deleted.

9,254 changes: 0 additions & 9,254 deletions 8x8x8 cube/Base Board.s#6

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
452 changes: 452 additions & 0 deletions 8x8x8 cube/firmware/beta-cube-library.cpp

Large diffs are not rendered by default.

456 changes: 456 additions & 0 deletions 8x8x8 cube/firmware/beta-cube-library.cpp~

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions 8x8x8 cube/firmware/beta-cube-library.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#ifndef _L3D_H
#define _L3D_H

#include "application.h"
#include "neopixel.h"

#if defined(PLATFORM_ID)
#if (PLATFORM_ID == 0) // Core
#define PROCESSOR "core"
#elif (PLATFORM_ID == 6) // Photon
#define PROCESSOR "photon"
#else
#define PROCESSOR "unknown"
#endif
#else
#define PROCESSOR "core"
#endif

#define PIXEL_COUNT 512
#define PIXEL_PIN D0
#define PIXEL_TYPE WS2812B

#define INTERNET_BUTTON D2
#define MODE D3

#define STREAMING_PORT 2222

#define MICROPHONE 12
#define X 13
#define Y 14
#define Z 15

/** An RGB color. */
struct Color
{
unsigned char red, green, blue;

Color(int r, int g, int b) : red(r), green(g), blue(b) {}
Color() : red(0), green(0), blue(0) {}
};

/** A point in 3D space. */
struct Point
{
float x;
float y;
float z;
Point() : x(0), y(0), z(0) {}
Point(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
};

/** An L3D LED cube.
Provides methods for drawing in 3D. Controls the LED hardware.
*/
class Cube
{
private:
bool onlinePressed;
bool lastOnline;
Adafruit_NeoPixel strip;
UDP udp;
int lastUpdated;
char localIP[24];
int port;

public:
int size;
int maxBrightness;
Point center;
float theta, phi;
int accelerometerX, accelerometerY, accelerometerZ;
Cube(unsigned int s, unsigned int mb);
Cube(void);

void setVoxel(int x, int y, int z, Color col);
void setVoxel(Point p, Color col);
Color getVoxel(int x, int y, int z);
Color getVoxel(Point p);
void line(int x1, int y1, int z1, int x2, int y2, int z2, Color col);
void line(Point p1, Point p2, Color col);
void sphere(int x, int y, int z, int r, Color col);
void sphere(Point p, int r, Color col);
void shell(float x, float y, float z, float r, Color col);
void shell(float x, float y, float z, float r, float thickness, Color col);
void shell(Point p, float r, Color col);
void shell(Point p, float r, float thickness, Color col);
void updateAccelerometer();
void background(Color col);

Color colorMap(float val, float min, float max);
Color lerpColor(Color a, Color b, int val, int min, int max);

void begin(void);
void show(void);
void listen(void);
void initButtons(void);
void checkCloudButton(void);
void joinWifi(void);
void updateNetworkInfo(void);
};

// common colors
const Color black = Color(0x00, 0x00, 0x00);
const Color grey = Color(0x92, 0x95, 0x91);
const Color yellow = Color(0xff, 0xff, 0x14);
const Color magenta = Color(0xc2, 0x00, 0x78);
const Color orange = Color(0xf9, 0x73, 0x06);
const Color teal = Color(0x02, 0x93, 0x86);
const Color red = Color(0xe5, 0x00, 0x00);
const Color brown = Color(0x65, 0x37, 0x00);
const Color pink = Color(0xff, 0x81, 0xc0);
const Color blue = Color(0x03, 0x43, 0xdf);
const Color green = Color(0x15, 0xb0, 0x1a);
const Color purple = Color(0x7e, 0x1e, 0x9c);
const Color white = Color(0xff, 0xff, 0xff);

#endif
Loading

0 comments on commit 8f8869f

Please sign in to comment.