Skip to content

Commit

Permalink
Use const.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 30, 2013
1 parent e60385b commit d69584a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/examples/LoLShield_BasicTest/LoLShield_BasicTest.pde
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//Initialized in setup.

//Sets the time each frame is shown (milliseconds)
unsigned int blinkdelay = 1000 / 50;
const unsigned int blinkdelay = 1000 / 50;

/*
The BitMap array is what contains the frame data. Each line is one full frame.
Expand Down
8 changes: 4 additions & 4 deletions lib/examples/LoLShield_Breathe/LoLShield_Breathe.pde
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include "Charliplexing.h"

unsigned int inhale_time_ms = 500;
unsigned int hold_breath_ms = 600;
unsigned int exhale_time_ms = 800;
unsigned int pause_breath_ms = 2000;
const unsigned int inhale_time_ms = 500;
const unsigned int hold_breath_ms = 600;
const unsigned int exhale_time_ms = 800;
const unsigned int pause_breath_ms = 2000;

void setup() // run once, when the sketch starts
{
Expand Down
16 changes: 8 additions & 8 deletions lib/examples/LoLShield_DoubleHelix/LoLShield_DoubleHelix.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
// You can tweak these values to create a custom DNA molecule :)
//

float stretch = 0.44; // The width of each sine wave. Smaller values create wider sine waves. I like 0.44 .
const float stretch = 0.44; // The width of each sine wave. Smaller values create wider sine waves. I like 0.44 .

float phaseIncrement = 0.1; // How fast the sines move. I like 0.1 .
const float phaseIncrement = 0.1; // How fast the sines move. I like 0.1 .

// The phase of the "darker" sine wave will drift (relative to the "lighter" sine wave).
// This makes the DoubleHelix more organic/hypnotic .
float driftIncrement = 0.019; // The speed it drifts back and forth. Larger == faster. I like 0.019 .
float driftForce = 0.4; // The visual amount of drift. I like 0.4 .
const float driftIncrement = 0.019; // The speed it drifts back and forth. Larger == faster. I like 0.019 .
const float driftForce = 0.4; // The visual amount of drift. I like 0.4 .

// On every other column, light the LEDs between the sine waves, resembling the nucleotides of a DNA molecule.
// This looks good if we switch between lighting odd columns, then even columns -- the molecule appears to be moving.
float barPhaseIncrement = 0.09; // Bar movement speed. Plz use values between 0..1 . I like 0.09 .
const float barPhaseIncrement = 0.09; // Bar movement speed. Plz use values between 0..1 . I like 0.09 .

// Brightness values. Range is 0..7
byte lightSineBrightness = 7;
byte darkSineBrightness = 3;
byte barBrightness = 1;
const byte lightSineBrightness = 7;
const byte darkSineBrightness = 3;
const byte barBrightness = 1;

// (End tweak section)
/////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions lib/examples/LoLShield_FadeTest/LoLShield_FadeTest.pde
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
#include "Charliplexing.h"

// Screen "refresh"
unsigned int fps = 40;
unsigned int fps_ms = 1000 / fps;
const unsigned int fps = 40;
const unsigned int fps_ms = 1000 / fps;

unsigned int frames = 0;

// number of frames to wait before advance animation
unsigned int frames_per_step = 10;
const unsigned int frames_per_step = 10;

void setup() // run once, when the sketch starts
{
Expand All @@ -41,7 +41,7 @@ void setup() // run once, when the sketch starts
uint8_t i = 0;
void loop() // run over and over again
{
static unsigned long start = 0;
unsigned long start = 0;
unsigned long end;

for (int row = 0; row < DISPLAY_ROWS; row++)
Expand Down
2 changes: 1 addition & 1 deletion lib/examples/LoLShield_Life/LoLShield_Life.pde
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define SIZEX DISPLAY_COLS //Sets the X axis size
#define SIZEY DISPLAY_ROWS //Sets the Y axis size
byte world[2][SIZEX][SIZEY]; //Creates a double buffer world
long density = 50; //Sets density % during seeding
const int density = 50; //Sets density % during seeding
int geck = 0; //Counter for re-seeding

void setup() {
Expand Down
2 changes: 1 addition & 1 deletion lib/examples/LoLShield_Pong/LoLShield_Pong.pde
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* ---------------------------------------------------------------------------*/
/** The figures from 0 to 9 encoded in 7 lines of 5 bits :
*/
uint16_t figures[][7] = {
const uint16_t figures[][7] = {
{14,17,17,17,17,17,14},
{4,6,4,4,4,4,14},
{14,17,16,14,1,1,31},
Expand Down

0 comments on commit d69584a

Please sign in to comment.