GithubHelp home page GithubHelp logo

billpugh / pyramid-of-possibilities Goto Github PK

View Code? Open in Web Editor NEW
7.0 6.0 4.0 3.86 MB

For the Pyramid of Possibilities project for Burning Man

Arduino 0.77% C++ 1.63% C 0.15% Java 0.18% Objective-C 97.05% Shell 0.01% Objective-C++ 0.01% GLSL 0.01% Makefile 0.18%

pyramid-of-possibilities's Introduction

Pyramid-of-Possibilities

For the Pyramid of Possibilities project for Burning Man

pyramid-of-possibilities's People

Contributors

avandecreme avatar billpugh avatar brandenhall avatar cibomahto avatar jravetch avatar martymcguire avatar meelow avatar objectivesee avatar threeethan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyramid-of-possibilities's Issues

Standard Interface for Light Programs

@billpugh I propose a standard interface for calling into light 'programs' on the Teensy. It should be standardized so that we can switch between programs easily.

I was imagining something like this:

void program_setup(RNLight *strip);
void program_loop(RNLight *strip);
void program_teardown(RNLight *strip);

Each program gets a chance to setup and loop like a normal .ino program. The program_teardown() is called when the program is about to be switched to another program and lets us cleanup any memory. program_setup() is called before the program is run, and program_loop() is called just like in a .ino.

An initialized RNLight is passed to each program so they do not need to initialize the strip each time we switch programs.

We should also decide on which clock frequency we will use for the Teensys since that will effect the timing of programs.

Would love to hear thoughts on this proposal, as well as whether it should be a C++ or C interface!

RNLights function to set color using uint32_t

The RNLights functions to set pixel colors all take 3 parameters (red,green,blue). I have a lot of code that already has the colors in a uint32_t with the blue value being the significant byte.

@billpugh Can you add a setPixelColor() function that looks like this?

void setPixelColor(uint16_t pixel, uint32_t color);

This is consistent with what Adafruit provides.

What's up with setBrightness() ?

@billpugh I am seeing a lot of projects that use the setBrightness() function of the AdaFruit library. I have found versions of the library both with and without that function. Any idea what's up? Was it deprecated?

Latest commits break the LEDs

@billpugh I pulled you latest commits but the LEDs are no longer turning on. I am testing with the Beacon, FlashEcho and Qbert animations. When I jump back to an older commit (my last commit) then everything works fine. Thoughts on what may have changed? I can see serial logs on the monitor, so perhaps you changed the output pin of the LEDS or something like that.

Here are the console logs from FlashEcho

PoP board starting
04:E9:E5:00:89:C4
0 bytes read
10 platform size
Initializing accelerometer
Joined bus
Ready to read whoAmI
Send address to read: D
got whoami
1A
MMA8451Q is online...
Running. id =   0, xyz =    0,   0,   0
id   x    y    angle          g x  g y    angle        radius     
  0     0  -76  -90.000000       0  -76    270.000000   270.000000,   76.000000
  1    15  -74  -78.541252      15  -74    281.458740   281.458740,   75.504967
  2    30  -69  -66.501434      30  -69    293.498566Switching to animation 0
320 bytes allocated
Created FlashEcho

Logs from Qbert: (notice how it doesn't even get to say "Created Qbert")

PoP board starting
04:E9:E5:00:89:C4
0 bytes read
10 platform size
Initializing accelerometer
Joined bus
Ready to read whoAmI

Logs from Beacon:

PoP board starting
04:E9:E5:00:89:C4
0 bytes read
10 platform size
Initializing accelerometer
Joined bus
Ready to read whoAmI

RNLightTest not compiling

Hey, I am getting a compiler issue with the RNLightTest. Let me know if anything comes to mind for fixing it easily.

Compiling RNLightTest...
Creating /Users/danny/Documents/Arduino_Build/RNLightTest/RNLightTest.ino.cpp.o...
In file included from /Users/danny/Documents/Arduino/libraries/RNLights/RNLightsOctoWS2811.h:12:0,
                 from /Users/danny/Documents/Arduino_Build/RNLightTest/RNLightTest.ino.cpp:6:
/Applications/Arduino.app/Contents/Resources/Java/libraries/OctoWS2811/OctoWS2811.h:36:7: error: redefinition of 'class OctoWS2811'
In file included from /Users/danny/Documents/Arduino_Build/RNLightTest/RNLightTest.ino.cpp:4:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/OctoWS2811/OctoWS2811.h:36:7: error: previous definition of 'class OctoWS2811'
/Users/danny/Documents/Arduino_Build/RNLightTest/RNLightTest.ino.cpp: In function 'void loop()':
/Users/danny/Documents/Arduino_Build/RNLightTest/RNLightTest.ino.cpp:53:53: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
[Stino - Error 1

Question about using an object as an animation parameter

@billpugh I just want to make sure that it is ok to use an RNGradient object as an animation parameter. I could imagine it going wrong, but if you're ok with it then I am too ;)

struct RadialParameters {
    uint8_t bpm = 25;    // beats per minute
    float thickness = 100;
    RNGradient gradientInside = RNGradient(0, RNGradientCapped, 0x000000, 0x000000); 
    RNGradient gradientShell = RNGradient(0, RNGradientCapped, 0xFF0000, 0xFF0000); 
    RNGradient gradientOutside = RNGradient(0, RNGradientCapped, 0x000000, 0x000000);   
};

Simulation0 compilation under linux

I am not sure whether the goal is to make it cross platform or not but I tried to compile MyOpenGLView.m under linux.

Prerequisite: install GNUstep

Here is the command line I used:

gcc MyOpenGLView.m -lGL -lGLU -lGLUT -std=c99 -lobjc -lgnustep-base -w -fconstant-string-class=NSConstantString

Also, I needed to add the following includes in the .h:

#include <GL/gl.h>
#include <GL/glu.h>

and replace OpenGL by GL in the .m

Then the main issue I am having is that I can't find a linux implementation of GLKit.
Here is my console output:

In file included from MyOpenGLView.m:9:0:
MyOpenGLView.h:31:5: error: unknown type name ‘CFAbsoluteTime’
     CFAbsoluteTime msgTime; // message posting time for expiration
     ^
MyOpenGLView.h:43:5: error: unknown type name ‘CFAbsoluteTime’
     CFAbsoluteTime time;
     ^
MyOpenGLView.m:41:1: error: unknown type name ‘CFAbsoluteTime’
 CFAbsoluteTime gMsgPresistance = 10.0f;
 ^
MyOpenGLView.m:47:9: error: variably modified ‘triangleCenter’ at file scope
 GLfloat triangleCenter[num_triangles][2];
         ^
MyOpenGLView.m: In function ‘-[MyOpenGLView initOpenGL]’:
MyOpenGLView.m:123:40: error: ‘pmax’ undeclared (first use in this function)
         glGetFloatv(GL_POINT_SIZE_MAX, pmax);
                                        ^
MyOpenGLView.m:123:40: note: each undeclared identifier is reported only once for each function it appears in
MyOpenGLView.m:126:59: error: ‘pointParams’ undeclared (first use in this function)
         glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, pointParams);
                                                           ^
MyOpenGLView.m: In function ‘-[MyOpenGLView updateProjection2]’:
MyOpenGLView.m:233:5: error: unknown type name ‘GLKMatrix4’
     GLKMatrix4 p = GLKMatrix4MakePerspective(3.14159*50.0/180,((float)camera.viewHeight)/camera.viewWidth, 1.0, 7.0);
     ^
MyOpenGLView.m:234:20: error: request for member ‘m’ in something not a structure or union
     glLoadMatrixf(p.m);
                    ^
MyOpenGLView.m: In function ‘-[MyOpenGLView updateModelView]’:
MyOpenGLView.m:261:7: error: ‘gTrackingViewInfo’ undeclared (first use in this function)
  if ((gTrackingViewInfo == self) && gTrackBallRotation[0] != 0.0f) {
       ^
MyOpenGLView.m:261:37: error: ‘gTrackBallRotation’ undeclared (first use in this function)
  if ((gTrackingViewInfo == self) && gTrackBallRotation[0] != 0.0f) {
                                     ^
MyOpenGLView.m: At top level:
MyOpenGLView.m:302:13: error: static declaration of ‘definePlatforms’ follows non-static declaration
 static void definePlatforms ()
             ^
MyOpenGLView.m:131:9: note: previous implicit declaration of ‘definePlatforms’ was here
         definePlatforms();
         ^
MyOpenGLView.m:343:13: error: static declaration of ‘drawModel’ follows non-static declaration
 static void drawModel() {
             ^
MyOpenGLView.m:336:5: note: previous implicit declaration of ‘drawModel’ was here
     drawModel();
     ^
MyOpenGLView.m:360:13: error: static declaration of ‘drawAnObject’ follows non-static declaration
 static void drawAnObject (GLfloat fSize)
             ^
MyOpenGLView.m:289:5: note: previous implicit declaration of ‘drawAnObject’ was here
     drawAnObject(1.0);
     ^
MyOpenGLView.m:468:1: error: unknown type name ‘CFAbsoluteTime’
 - (void) updateObjectRotationForTimeDelta:(CFAbsoluteTime)deltaTime
 ^
MyOpenGLView.m: In function ‘-[MyOpenGLView updateObjectRotationForTimeDelta:]’:
MyOpenGLView.m:478:24: error: invalid operands to binary * (have ‘GLfloat’ and ‘id’)
   rVel[i] += rAccel[i] * deltaTime * 30.0;
                        ^
MyOpenGLView.m:488:22: error: invalid operands to binary * (have ‘GLfloat’ and ‘id’)
   rRot[i] += rVel[i] * deltaTime * 30.0;
                      ^
MyOpenGLView.m: At top level:
MyOpenGLView.m:510:1: error: unknown type name ‘CFAbsoluteTime’
 static CFAbsoluteTime gStartTime = 0.0f;
 ^
MyOpenGLView.m:513:13: error: static declaration of ‘setStartTime’ follows non-static declaration
 static void setStartTime (void)
             ^
MyOpenGLView.m:89:5: note: previous implicit declaration of ‘setStartTime’ was here
     setStartTime (); // get app start time
     ^
MyOpenGLView.m:519:1: error: unknown type name ‘CFAbsoluteTime’
 static CFAbsoluteTime getElapsedTime (void)
 ^
MyOpenGLView.m: In function ‘-[MyOpenGLView animationTimer:]’:
MyOpenGLView.m:529:3: error: unknown type name ‘CFTimeInterval’
   CFTimeInterval deltaTime = CFAbsoluteTimeGetCurrent () - time;
   ^

Update Adafruit_NeoPixel.h

@billpugh The new version of Adafruit_NeoPixel.h correctly includes:

#ifndef ADAFRUIT_NEOPIXEL_H
#define ADAFRUIT_NEOPIXEL_H

It also includes the setBrightness() function. Should we update to using their libraries now?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.