Subversion Repositories Code-Repo

Compare Revisions

Regard whitespace Rev 226 → Rev 231

/PIC Stuff/Cerebot_32MX7_LED_Cube/ANIMATIONS.c
2,8 → 2,8
#include "ANIMATIONS.h"
#include "CUBE.h"
 
void Animation_Solid_Colors(int iterations, int delay_ms) {
int i;
void Animation_Solid_Colors(uint8_t iterations, uint16_t delay_ms) {
uint8_t i;
for (i = 0; i < iterations; i++) {
Cube_Set_All(RED);
Delay_MS(delay_ms);
14,8 → 14,8
}
}
 
void Animation_Layer_Alternate(int iterations, int delay_ms) {
int i,z;
void Animation_Layer_Alternate(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
47,14 → 47,14
}
}
 
void Animation_Pixel_Alternate(int iterations, int delay_ms) {
int i,j,k,z;
void Animation_Pixel_Alternate(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,j,k,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
int32_t var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (var % 3 == 1)
67,7 → 67,7
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
int32_t var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,GREEN);
else if (var % 3 == 1)
80,7 → 80,7
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
int32_t var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,BLUE);
else if (var % 3 == 1)
94,8 → 94,8
}
}
 
void Animation_Full_Color_Sweep(int iterations, int delay_us) {
int i,z;
void Animation_Full_Color_Sweep(uint8_t iterations, uint16_t delay_us) {
int16_t i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(i,0,0);
125,7 → 125,7
Cube_Set_All(i,0,0x0FF);
Delay_US(delay_us);
}
for (i = 0x100; i >= 0; i-=2) {
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(0,0,i);
Delay_US(delay_us);
}
132,8 → 132,8
}
}
 
void Animation_Row_Column_Sweep(int iterations, int delay_ms) {
int i,j,k,a,z;
void Animation_Row_Column_Sweep(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,j,k,a,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < 3; i++) {
for (j = 0; j < CUBE_ROW_COUNT; j++) {
164,7 → 164,7
Cube_Set_Pixel(a,k,j,BLUE);
Delay_MS(delay_ms);
}
for (j = CUBE_LAYER_COUNT-1; j >= 0; j--) {
for (j = CUBE_LAYER_COUNT; j != 0; j--) {
Cube_Clear();
if (i % 3 == 0) {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
185,8 → 185,8
}
}
 
void Animation_Pixel_Sweep(int iterations, int delay_ms) {
int i,j,k,z,a;
void Animation_Pixel_Sweep(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,j,k,z,a;
for (z = 0; z < iterations; z++) {
for (a = 0; a < 3; a++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
208,13 → 208,13
}
}
 
void Animation_Pseudo_Random_Colors(int iterations, int delay_ms) {
int i,j,k,z;
void Animation_Pseudo_Random_Colors(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,j,k,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
unsigned int a = rand();
uint32_t a = rand();
if (a % 5 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (a % 5 == 1)
234,8 → 234,8
}
}
 
void Animation_Random_Colors(int iterations, int delay_ms) {
int i,j,k,z;
void Animation_Random_Colors(uint8_t iterations, uint16_t delay_ms) {
uint8_t i,j,k,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
for (j = 0; j < CUBE_ROW_COUNT; j++) {
248,8 → 248,8
}
}
 
void Animation_Cube_In_Cube(int iterations, int delay_ms) {
int z,x,i,j,k;
void Animation_Cube_In_Cube(uint8_t iterations, uint16_t delay_ms) {
uint8_t z,x,i,j,k;
for (z = 0; z < iterations; z++) {
for (x = 0; x < 5; x++) {
Cube_Clear();
300,9 → 300,9
}
}
 
void Animation_Double_Rotation(int iterations, int delay_ms) {
void Animation_Double_Rotation(uint8_t iterations, uint16_t delay_ms) {
Cube_Clear();
int i,x,y,z;
uint8_t i,x,y,z;
for (z = 0; z < 3; z++) {
switch (z % 3) {
case 0: