Use const.

This commit is contained in:
root
2013-08-30 06:33:44 +00:00
parent e60385b6c6
commit d69584a697
6 changed files with 19 additions and 19 deletions
@@ -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.
@@ -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
{
@@ -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)
/////////////////////////////////////////////////////////////////////////////
@@ -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
{
@@ -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++)
@@ -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() {
@@ -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},