Subversion Repositories Code-Repo

Compare Revisions

Regard whitespace Rev 224 → Rev 226

/PIC Stuff/Cerebot_32MX7_LED_Cube/ANIMATIONS.c
0,0 → 1,353
#include "defines.h"
#include "ANIMATIONS.h"
#include "CUBE.h"
 
void Animation_Solid_Colors(int iterations, int delay_ms) {
int i;
for (i = 0; i < iterations; i++) {
Cube_Set_All(RED);
Delay_MS(delay_ms);
Cube_Set_All(GREEN);
Delay_MS(delay_ms);
Cube_Set_All(BLUE);
Delay_MS(delay_ms);
}
}
 
void Animation_Layer_Alternate(int iterations, int delay_ms) {
int i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,RED);
else if (i % 3 == 1)
Cube_Set_Layer(i,GREEN);
else
Cube_Set_Layer(i,BLUE);
}
Delay_MS(delay_ms);
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,GREEN);
else if (i % 3 == 1)
Cube_Set_Layer(i,BLUE);
else
Cube_Set_Layer(i,RED);
}
Delay_MS(delay_ms);
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,BLUE);
else if (i % 3 == 1)
Cube_Set_Layer(i,RED);
else
Cube_Set_Layer(i,GREEN);
}
Delay_MS(delay_ms);
}
}
 
void Animation_Pixel_Alternate(int iterations, int delay_ms) {
int 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;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,GREEN);
else
Cube_Set_Pixel(i,j,k,BLUE);
}
}
Delay_MS(delay_ms);
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,GREEN);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,BLUE);
else
Cube_Set_Pixel(i,j,k,RED);
}
}
Delay_MS(delay_ms);
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,BLUE);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,RED);
else
Cube_Set_Pixel(i,j,k,GREEN);
}
}
Delay_MS(delay_ms);
}
}
}
 
void Animation_Full_Color_Sweep(int iterations, int delay_us) {
int i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(i,0,0);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(0x0FF,i,0);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(i,0x0FF,0);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(0,0x0FF,i);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(i,0x0FF,0x0FF);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(0x0FF,i,0x0FF);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(i,0,0x0FF);
Delay_US(delay_us);
}
for (i = 0x100; i >= 0; i-=2) {
Cube_Set_All(0,0,i);
Delay_US(delay_us);
}
}
}
 
void Animation_Row_Column_Sweep(int iterations, int delay_ms) {
int 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++) {
Cube_Clear();
for (k = 0; k < CUBE_COLUMN_COUNT; k++)
if (i % 3 == 0)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,RED);
else if (i % 3 == 1)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,GREEN);
else
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,BLUE);
Delay_MS(delay_ms);
}
for (j = 0; j < CUBE_ROW_COUNT; j++) {
Cube_Clear();
for (k = 0; k < CUBE_COLUMN_COUNT; k++)
if (i % 3 == 0)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,RED);
else if (i % 3 == 1)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,GREEN);
else
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,BLUE);
Delay_MS(delay_ms);
}
for (j = CUBE_LAYER_COUNT-1; j >= 0; j--) {
Cube_Clear();
if (i % 3 == 0) {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,RED);
} else if (i % 3 == 1) {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,GREEN);
} else {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,BLUE);
}
Delay_MS(delay_ms);
}
}
}
}
 
void Animation_Pixel_Sweep(int iterations, int delay_ms) {
int 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++) {
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
Cube_Clear();
if (a % 3 == 0) {
Cube_Set_Pixel(i,j,k,RED);
} else if (a % 3 == 1) {
Cube_Set_Pixel(i,j,k,GREEN);
} else {
Cube_Set_Pixel(i,j,k,BLUE);
}
Delay_MS(delay_ms);
}
}
}
}
}
}
 
void Animation_Pseudo_Random_Colors(int iterations, int delay_ms) {
int 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();
if (a % 5 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (a % 5 == 1)
Cube_Set_Pixel(i,j,k,GREEN);
else if (a % 5 == 2)
Cube_Set_Pixel(i,j,k,BLUE);
else if (a % 5 == 3)
Cube_Set_Pixel(i,j,k,PURPLE);
else if (a % 5 == 4)
Cube_Set_Pixel(i,j,k,YELLOW);
else
Cube_Set_Pixel(i,j,k,ORANGE);
}
}
}
Delay_MS(delay_ms);
}
}
 
void Animation_Random_Colors(int iterations, int delay_ms) {
int 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++) {
Cube_Set_Pixel(i,j,k,rand()&0x0FF,rand()&0x0FF,rand()&0x0FF);
}
}
}
Delay_MS(delay_ms);
}
}
 
void Animation_Cube_In_Cube(int iterations, int delay_ms) {
int z,x,i,j,k;
for (z = 0; z < iterations; z++) {
for (x = 0; x < 5; x++) {
Cube_Clear();
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if ((x == 0 || x == 4)&&(i == 0 || i == 7)) {
Cube_Set_Layer(i,RED);
} else if ((x == 1 || x == 4)&&(i == 1 || i == 6)) {
for (j = 1; j < CUBE_ROW_COUNT-1; j++)
for (k = 1; k < CUBE_COLUMN_COUNT-1; k++)
Cube_Set_Pixel(i,j,k,YELLOW);
} else if ((x == 2 || x == 4)&&(i == 2 || i == 5)) {
for (j = 2; j < CUBE_ROW_COUNT-2; j++)
for (k = 2; k < CUBE_COLUMN_COUNT-2; k++)
Cube_Set_Pixel(i,j,k,GREEN);
} else if ((x == 3 || x == 4)&&(i == 3 || i == 4)) {
for (j = 3; j < CUBE_ROW_COUNT-3; j++)
for (k = 3; k < CUBE_COLUMN_COUNT-3; k++)
Cube_Set_Pixel(i,j,k,BLUE);
}
 
if ((x == 0 || x == 4)&&(i > 0 && i < 8)) {
for (j = 0; j < 8; j++) {
Cube_Set_Pixel(i,j,0,RED);
Cube_Set_Pixel(i,j,7,RED);
Cube_Set_Pixel(i,0,j,RED);
Cube_Set_Pixel(i,7,j,RED);
}
}
if ((x == 1 || x == 4)&&(i > 1 && i < 7)) {
for (j = 1; j < 7; j++) {
Cube_Set_Pixel(i,j,1,YELLOW);
Cube_Set_Pixel(i,j,6,YELLOW);
Cube_Set_Pixel(i,1,j,YELLOW);
Cube_Set_Pixel(i,6,j,YELLOW);
}
}
if ((x == 2 || x == 4)&&(i > 2 && i < 6)) {
for (j = 2; j < 6; j++) {
Cube_Set_Pixel(i,j,2,GREEN);
Cube_Set_Pixel(i,j,5,GREEN);
Cube_Set_Pixel(i,2,j,GREEN);
Cube_Set_Pixel(i,5,j,GREEN);
}
}
}
Delay_MS(delay_ms);
}
}
}
 
void Animation_Double_Rotation(int iterations, int delay_ms) {
Cube_Clear();
int i,x,y,z;
for (z = 0; z < 3; z++) {
switch (z % 3) {
case 0:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,RED);
Cube_Set_Pixel(y,1,1,RED);
Cube_Set_Pixel(y,2,2,RED);
Cube_Set_Pixel(y,3,3,RED);
Cube_Set_Pixel(y,4,4,RED);
Cube_Set_Pixel(y,5,5,RED);
Cube_Set_Pixel(y,6,6,RED);
Cube_Set_Pixel(y,7,7,RED);
}
break;
case 1:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,GREEN);
Cube_Set_Pixel(y,1,1,GREEN);
Cube_Set_Pixel(y,2,2,GREEN);
Cube_Set_Pixel(y,3,3,GREEN);
Cube_Set_Pixel(y,4,4,GREEN);
Cube_Set_Pixel(y,5,5,GREEN);
Cube_Set_Pixel(y,6,6,GREEN);
Cube_Set_Pixel(y,7,7,GREEN);
}
break;
case 2:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,BLUE);
Cube_Set_Pixel(y,1,1,BLUE);
Cube_Set_Pixel(y,2,2,BLUE);
Cube_Set_Pixel(y,3,3,BLUE);
Cube_Set_Pixel(y,4,4,BLUE);
Cube_Set_Pixel(y,5,5,BLUE);
Cube_Set_Pixel(y,6,6,BLUE);
Cube_Set_Pixel(y,7,7,BLUE);
}
break;
}
 
for (i = 0; i < iterations; i++) {
for (x = 0; x < 28; x++) {
Delay_MS(delay_ms);
Cube_Rotate(0);
}
}
}
}
/PIC Stuff/Cerebot_32MX7_LED_Cube/ANIMATIONS.h
0,0 → 1,16
#ifndef ANIMATIONS_H
#define ANIMATIONS_H
 
void Animation_Solid_Colors(int iterations, int delay_ms);
void Animation_Layer_Alternate(int iterations, int delay_ms);
void Animation_Pixel_Alternate(int iterations, int delay_ms);
void Animation_Full_Color_Sweep(int iterations, int delay_us);
void Animation_Row_Column_Sweep(int iterations, int delay_ms);
void Animation_Pixel_Sweep(int iterations, int delay_ms);
void Animation_Pseudo_Random_Colors(int iterations,int delay_ms);
void Animation_Random_Colors(int iterations, int delay_ms);
void Animation_Cube_In_Cube(int iterations, int delay_ms);
void Animation_Double_Rotation(int iterations, int delay_ms);
 
#endif /* ANIMATIONS_H */
 
/PIC Stuff/Cerebot_32MX7_LED_Cube/SPI1.c
45,19 → 45,19
INTEnableInterrupts();
}
 
int SPI1_Write(unsigned char *array, unsigned int count, void (*tx_callback)(void)) {
int SPI1_Write(char *array, int length, void (*tx_callback)(void)) {
spi_data_ptr->tx_callback = tx_callback;
 
if (count > SPI1_BUFFER_SIZE)
if (length > SPI1_BUFFER_OUT_SIZE)
return 0;
if (spi_data_ptr->buffer_out_len != 0)
return 0;
 
// Put the data to send into the outbound buffer
spi_data_ptr->buffer_out_len = count;
spi_data_ptr->buffer_out_ind = count-1;
spi_data_ptr->buffer_out_len = length;
spi_data_ptr->buffer_out_ind = length-1;
int i;
for (i = 0; i < count; i++) {
for (i = 0; i < length; i++) {
spi_data_ptr->buffer_out[i] = array[i];
}
IEC0SET = 0x02000000; // Enable TX interrupt
/PIC Stuff/Cerebot_32MX7_LED_Cube/SPI1.h
1,12 → 1,13
#ifndef SPI1_H
#define SPI1_H
 
#define SPI1_BUFFER_SIZE 300
#define SPI1_BUFFER_OUT_SIZE 300
//#define SPI1_BUFFER_IN_SIZE 10
 
#define SPI_WRITE_ONLY
 
typedef struct {
char buffer_out[SPI1_BUFFER_SIZE];
char buffer_out[SPI1_BUFFER_OUT_SIZE];
int buffer_out_ind;
int buffer_out_len;
 
16,7 → 17,7
 
void SPI1_Init(SPI1_DATA *data, void (*rx_callback)(char));
// Note: SPI1_Write() writes MSB -> LSB!
int SPI1_Write(unsigned char *array, unsigned int count, void (*tx_callback)(void));
int SPI1_Write(char *array, int length, void (*tx_callback)(void));
 
#endif /* SPI1_H */
 
/PIC Stuff/Cerebot_32MX7_LED_Cube/SPI4.c
0,0 → 1,153
#include <xc.h>
#include <plib.h>
#include "defines.h"
#include "SPI4.h"
 
static SPI4_DATA *spi_data_ptr;
 
void SPI4_Init(SPI4_DATA *data) {
spi_data_ptr = data;
spi_data_ptr->buffer_out_ind = 0;
spi_data_ptr->buffer_out_len = 0;
spi_data_ptr->buffer_in_ind = 0;
spi_data_ptr->buffer_in_len = 0;
spi_data_ptr->write_blank = 0;
 
INTDisableInterrupts();
 
// Note: FIFO enhanced buffer depth is 4/8/16 for 32/16/8 bit widths
 
// FSCK = FPB / (2 * (SPIxBRG + 1))
IEC1CLR = 0x00000700; // Disable all SPI interrupts
SPI4CON = 0; // Stops and resets the SPI4.
int tmp = SPI4BUF; // Clears the receive buffer
IFS1CLR = 0x00000700; // Clear any existing event
IPC8CLR = 0x0000001F; // Clear the priority
IPC8SET = 0x0000001A; // Set IPL=6, Subpriority 2
SPI4BRG = 0x4; // Use FPB/10 clock frequency
SPI4STATCLR = 0x40; // Clear the Overflow
IEC1SET = 0x00000300; // Enable RX and Error interrupts
 
// Enhanced buffer, SPI on, 8 bits transfer, SMP=1, Master mode
// SPIxTXIF set on buffer empty, SPIxRXIF set on buffer not empty
SPI4CON = 0x18225;
 
INTEnableInterrupts();
}
 
int SPI4_Read(int length, void (*rx_callback)(char, char *)) {
spi_data_ptr->rx_callback = rx_callback;
 
// Ensure that the receiving buffer is large enough
if (length > SPI4_BUFFER_IN_SIZE)
return 0;
// Ensure that no previous transactions are in progress
if (spi_data_ptr->buffer_in_len != 0)
return 0;
 
spi_data_ptr->write_blank = 1;
spi_data_ptr->buffer_in_len = length;
spi_data_ptr->buffer_in_ind = 0;
SPI4_Write(NULL, length, NULL);
return 1;
}
 
int SPI4_Write(char *array, int length, void (*tx_callback)(void)) {
spi_data_ptr->tx_callback = tx_callback;
 
// We only care about the transmit length if we are sending data
if (length > SPI4_BUFFER_OUT_SIZE && !spi_data_ptr->write_blank)
return 0;
 
// Ensure that no previous transactions are in progress
if (spi_data_ptr->buffer_out_len != 0)
return 0;
 
// Put the data to send into the outbound buffer
spi_data_ptr->buffer_out_len = length;
spi_data_ptr->buffer_out_ind = 0;
 
// Copy only if we are actually going to transmit data
if (!spi_data_ptr->write_blank) {
int i;
for (i = 0; i < length; i++) {
spi_data_ptr->buffer_out[i] = array[i];
}
}
IEC1SET = 0x00000400; // Enable TX interrupt
return 1;
}
 
void __ISR(_SPI_4_VECTOR, ipl6) __SPI_4_Interrupt_Handler(void) {
// Process SPI4 error flag
if (IFS1bits.SPI4EIF) {
// Clear the receive overflow bit if it is set
if (SPI4STATbits.SPIROV) {
SPI4STATbits.SPIROV = 0;
}
IFS1CLR = 0x00000100; // Clear the error flag
}
 
// Process SPI4 receive flag
if (IFS1bits.SPI4RXIF) {
int i;
// Read the data received from the last transfer
int rxBufferCount = SPI4STATbits.RXBUFELM;
for (i = 0; i < rxBufferCount; i++) {
char c = SPI4BUF;
// Put the received data into the buffer
if (spi_data_ptr->buffer_in_len != 0) {
spi_data_ptr->buffer_in[spi_data_ptr->buffer_in_ind] = c;
spi_data_ptr->buffer_in_ind++;
// If done acquiring requested length, reset
if (spi_data_ptr->buffer_in_ind == spi_data_ptr->buffer_in_len) {
// Call the RX callback function on the received data
if (spi_data_ptr->rx_callback != NULL)
(*spi_data_ptr->rx_callback)(spi_data_ptr->buffer_in_len, spi_data_ptr->buffer_in);
spi_data_ptr->buffer_in_len = 0;
}
}
}
IFS1CLR = 0x00000200; // Clear the RX flag
}
 
// Process SPI4 transmit flag
if (IFS1bits.SPI4TXIF && IEC1bits.SPI4TXIE) {
int i;
// Disable the transmit interrupt if all data has been sent
if (spi_data_ptr->buffer_out_len == 0) {
IEC1CLR=0x00000400;
spi_data_ptr->write_blank = 0;
// Call the TX callback function at end of transmission
if (spi_data_ptr->tx_callback != NULL)
(*spi_data_ptr->tx_callback)();
} else {
// Start transmitting the data in the buffer
int txBufferFree = 16 - SPI4STATbits.TXBUFELM;
if (spi_data_ptr->buffer_out_len > txBufferFree) {
for (i = 0; i < txBufferFree; i++) {
if (spi_data_ptr->write_blank) {
SPI4BUF = 0x00;
} else {
SPI4BUF = spi_data_ptr->buffer_out[spi_data_ptr->buffer_out_ind];
spi_data_ptr->buffer_out_ind++;
}
}
spi_data_ptr->buffer_out_len -= txBufferFree;
} else {
for (i = 0; i < spi_data_ptr->buffer_out_len; i++) {
if (spi_data_ptr->write_blank) {
SPI4BUF = 0x00;
} else {
SPI4BUF = spi_data_ptr->buffer_out[spi_data_ptr->buffer_out_ind];
spi_data_ptr->buffer_out_ind++;
}
}
spi_data_ptr->buffer_out_len = 0;
}
}
IFS1CLR = 0x00000400; // Clear the TX flag
}
}
/PIC Stuff/Cerebot_32MX7_LED_Cube/SPI4.h
0,0 → 1,26
#ifndef SPI4_H
#define SPI4_H
 
#define SPI4_BUFFER_OUT_SIZE 10
#define SPI4_BUFFER_IN_SIZE 10
 
typedef struct {
char buffer_out[SPI4_BUFFER_OUT_SIZE];
int buffer_out_ind;
int buffer_out_len;
char write_blank;
 
char buffer_in[SPI4_BUFFER_IN_SIZE];
int buffer_in_ind;
int buffer_in_len;
 
void (*tx_callback)(void);
void (*rx_callback)(char, char *);
} SPI4_DATA;
 
void SPI4_Init(SPI4_DATA *data);
int SPI4_Read(int length, void (*rx_callback)(char, char *));
int SPI4_Write(char *array, int length, void (*tx_callback)(void));
 
#endif /* SPI4_H */
 
/PIC Stuff/Cerebot_32MX7_LED_Cube/defines.h
1,8 → 1,8
// PIC32MX795F512L
 
// Uncomment ONE of the following:
#define CEREBOT_32MX7
// #define CEREBOT_MX7CK
//#define CEREBOT_32MX7
#define CEREBOT_MX7CK
 
// Power supply must be 5V for proper operation of the board!
 
/PIC Stuff/Cerebot_32MX7_LED_Cube/main.c
20,8 → 20,8
#pragma config FVBUSONIO = OFF // USB VBUS ON Selection
#pragma config FUSBIDIO = OFF // USB USID Selection
/* Other Peripheral Device Settings */
#pragma config FWDTEN = OFF // Watchdog Timer Enable
#pragma config WDTPS = PS1024 // Watchdog Timer Postscaler
#pragma config FWDTEN = ON // Watchdog Timer Enable
#pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1048.576s)
#pragma config FSRSSEL = PRIORITY_7 // SRS Interrupt Priority
#pragma config FCANIO = OFF // CAN I/O Pin Select (default/alternate)
#pragma config FETHIO = ON // Ethernet I/O Pin Select (default/alternate)
41,24 → 41,16
#include "defines.h"
#include "UART1.h"
#include "SPI1.h"
#include "SPI4.h"
#include "TIMER4.h"
#include "TIMER5.h"
#include "CUBE.h"
#include "BTN.h"
#include "ANIMATIONS.h"
 
void BTN1_Interrupt(void);
void BTN2_Interrupt(void);
void BTN3_Interrupt(void);
void Animation_Solid_Colors(int iterations, int delay_ms);
void Animation_Layer_Alternate(int iterations, int delay_ms);
void Animation_Pixel_Alternate(int iterations, int delay_ms);
void Animation_Full_Color_Sweep(int iterations, int delay_us);
void Animation_Row_Column_Sweep(int iterations, int delay_ms);
void Animation_Pixel_Sweep(int iterations, int delay_ms);
void Animation_Pseudo_Random_Colors(int iterations,int delay_ms);
void Animation_Random_Colors(int iterations, int delay_ms);
void Animation_Cube_In_Cube(int iterations, int delay_ms);
void Animation_Double_Rotation(int iterations, int delay_ms);
 
void Delay_MS(unsigned int delay_ms) {
// Delays the CPU for the given amount of time.
77,6 → 69,8
}
 
int main() {
// WARNING!! THIS BOARD WILL RESET EVERY 1048.576s DUE TO THE WDT!!
/* Configure the target for maximum performance at 80 MHz. */
// Note: This overrides the peripheral clock to 80Mhz regardless of config
SYSTEMConfigPerformance(CPU_CLOCK_HZ);
88,9 → 82,13
AD1PCFGSET = 0xFFFF;
 
// Initialize the SPI1 module
SPI1_DATA spi_data;
SPI1_Init(&spi_data, NULL);
SPI1_DATA spi_1_data;
SPI1_Init(&spi_1_data, NULL);
 
// Initialize the SPI4 module
SPI4_DATA spi_4_data;
SPI4_Init(&spi_4_data);
 
// Initialize the UART1 module
UART1_DATA uart_data;
UART1_Init(&uart_data, &Cube_Data_In);
111,7 → 109,7
 
// Start the overlay rotation interrupt
TIMER4_DATA timer_4_data;
TIMER4_Init(&timer_4_data, &Cube_Text_Interrupt, 120000);
TIMER4_Init(&timer_4_data, &Cube_Text_Interrupt, 90000);
 
// Process button inputs
BTN_DATA btn_data;
120,18 → 118,19
// Begin display
 
// Cube_Set_All(RED);
// Delay_MS(6000);
// Delay_MS(2000);
// Cube_Set_All(GREEN);
// Delay_MS(6000);
// Delay_MS(2000);
// Cube_Set_All(BLUE);
// Delay_MS(6000);
// Delay_MS(2000);
// Animation_Pseudo_Random_Colors(10,300);
 
// char start_text[] = "Cube Initialized\r\n";
// UART1_Write(start_text, 18);
 
// Set the overlay text
char text_string[] = "Welcome to the CCM Lab ";
Cube_Text_Init(text_string, 26, 0xFF, 0xFF, 0xFF);
char text_string[] = "Welcome to the AMP Lab ";
Cube_Text_Init(text_string, 27, 0xFF, 0xFF, 0xFF);
TIMER4_Start();
 
// Loop through some preset animations
143,8 → 142,10
Animation_Row_Column_Sweep(2,40);
Animation_Cube_In_Cube(4,300);
Animation_Double_Rotation(2,40);
Animation_Pseudo_Random_Colors(10,300);
// Animation_Pseudo_Random_Colors(10,300);
// Animation_Random_Colors(10,300);
 
// ClearWDT(); // Clear the WDT if we dont want the board to reset
}
}
 
231,353 → 232,3
}
TIMER4_Start();
}
 
void Animation_Solid_Colors(int iterations, int delay_ms) {
int i;
for (i = 0; i < iterations; i++) {
Cube_Set_All(RED);
Delay_MS(delay_ms);
Cube_Set_All(GREEN);
Delay_MS(delay_ms);
Cube_Set_All(BLUE);
Delay_MS(delay_ms);
}
}
 
void Animation_Layer_Alternate(int iterations, int delay_ms) {
int i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,RED);
else if (i % 3 == 1)
Cube_Set_Layer(i,GREEN);
else
Cube_Set_Layer(i,BLUE);
}
Delay_MS(delay_ms);
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,GREEN);
else if (i % 3 == 1)
Cube_Set_Layer(i,BLUE);
else
Cube_Set_Layer(i,RED);
}
Delay_MS(delay_ms);
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if (i % 3 == 0)
Cube_Set_Layer(i,BLUE);
else if (i % 3 == 1)
Cube_Set_Layer(i,RED);
else
Cube_Set_Layer(i,GREEN);
}
Delay_MS(delay_ms);
}
}
 
void Animation_Pixel_Alternate(int iterations, int delay_ms) {
int 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;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,GREEN);
else
Cube_Set_Pixel(i,j,k,BLUE);
}
}
Delay_MS(delay_ms);
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,GREEN);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,BLUE);
else
Cube_Set_Pixel(i,j,k,RED);
}
}
Delay_MS(delay_ms);
Cube_Clear();
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
int var = (j * 8) + k;
if (var % 3 == 0)
Cube_Set_Pixel(i,j,k,BLUE);
else if (var % 3 == 1)
Cube_Set_Pixel(i,j,k,RED);
else
Cube_Set_Pixel(i,j,k,GREEN);
}
}
Delay_MS(delay_ms);
}
}
}
 
void Animation_Full_Color_Sweep(int iterations, int delay_us) {
int i,z;
for (z = 0; z < iterations; z++) {
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(i,0,0);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(0x0FF,i,0);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(i,0x0FF,0);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(0,0x0FF,i);
Delay_US(delay_us);
}
for (i = 0; i < 0x0FF; i+=2) {
Cube_Set_All(i,0x0FF,0x0FF);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(0x0FF,i,0x0FF);
Delay_US(delay_us);
}
for (i = 0x0FF; i >= 0; i-=2) {
Cube_Set_All(i,0,0x0FF);
Delay_US(delay_us);
}
for (i = 0x100; i >= 0; i-=2) {
Cube_Set_All(0,0,i);
Delay_US(delay_us);
}
}
}
 
void Animation_Row_Column_Sweep(int iterations, int delay_ms) {
int 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++) {
Cube_Clear();
for (k = 0; k < CUBE_COLUMN_COUNT; k++)
if (i % 3 == 0)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,RED);
else if (i % 3 == 1)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,GREEN);
else
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,j,k,BLUE);
Delay_MS(delay_ms);
}
for (j = 0; j < CUBE_ROW_COUNT; j++) {
Cube_Clear();
for (k = 0; k < CUBE_COLUMN_COUNT; k++)
if (i % 3 == 0)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,RED);
else if (i % 3 == 1)
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,GREEN);
else
for (a = 0; a < CUBE_LAYER_COUNT; a++)
Cube_Set_Pixel(a,k,j,BLUE);
Delay_MS(delay_ms);
}
for (j = CUBE_LAYER_COUNT-1; j >= 0; j--) {
Cube_Clear();
if (i % 3 == 0) {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,RED);
} else if (i % 3 == 1) {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,GREEN);
} else {
for (k = 0; k < CUBE_LAYER_COUNT; k++)
if (k == j)
Cube_Set_Layer(k,BLUE);
}
Delay_MS(delay_ms);
}
}
}
}
 
void Animation_Pixel_Sweep(int iterations, int delay_ms) {
int 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++) {
for (j = 0; j < CUBE_ROW_COUNT; j++) {
for (k = 0; k < CUBE_COLUMN_COUNT; k++) {
Cube_Clear();
if (a % 3 == 0) {
Cube_Set_Pixel(i,j,k,RED);
} else if (a % 3 == 1) {
Cube_Set_Pixel(i,j,k,GREEN);
} else {
Cube_Set_Pixel(i,j,k,BLUE);
}
Delay_MS(delay_ms);
}
}
}
}
}
}
 
void Animation_Pseudo_Random_Colors(int iterations, int delay_ms) {
int 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();
if (a % 5 == 0)
Cube_Set_Pixel(i,j,k,RED);
else if (a % 5 == 1)
Cube_Set_Pixel(i,j,k,GREEN);
else if (a % 5 == 2)
Cube_Set_Pixel(i,j,k,BLUE);
else if (a % 5 == 3)
Cube_Set_Pixel(i,j,k,PURPLE);
else if (a % 5 == 4)
Cube_Set_Pixel(i,j,k,YELLOW);
else
Cube_Set_Pixel(i,j,k,ORANGE);
}
}
}
Delay_MS(delay_ms);
}
}
 
void Animation_Random_Colors(int iterations, int delay_ms) {
int 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++) {
Cube_Set_Pixel(i,j,k,rand()&0x0FF,rand()&0x0FF,rand()&0x0FF);
}
}
}
Delay_MS(delay_ms);
}
}
 
void Animation_Cube_In_Cube(int iterations, int delay_ms) {
int z,x,i,j,k;
for (z = 0; z < iterations; z++) {
for (x = 0; x < 5; x++) {
Cube_Clear();
for (i = 0; i < CUBE_LAYER_COUNT; i++) {
if ((x == 0 || x == 4)&&(i == 0 || i == 7)) {
Cube_Set_Layer(i,RED);
} else if ((x == 1 || x == 4)&&(i == 1 || i == 6)) {
for (j = 1; j < CUBE_ROW_COUNT-1; j++)
for (k = 1; k < CUBE_COLUMN_COUNT-1; k++)
Cube_Set_Pixel(i,j,k,YELLOW);
} else if ((x == 2 || x == 4)&&(i == 2 || i == 5)) {
for (j = 2; j < CUBE_ROW_COUNT-2; j++)
for (k = 2; k < CUBE_COLUMN_COUNT-2; k++)
Cube_Set_Pixel(i,j,k,GREEN);
} else if ((x == 3 || x == 4)&&(i == 3 || i == 4)) {
for (j = 3; j < CUBE_ROW_COUNT-3; j++)
for (k = 3; k < CUBE_COLUMN_COUNT-3; k++)
Cube_Set_Pixel(i,j,k,BLUE);
}
 
if ((x == 0 || x == 4)&&(i > 0 && i < 8)) {
for (j = 0; j < 8; j++) {
Cube_Set_Pixel(i,j,0,RED);
Cube_Set_Pixel(i,j,7,RED);
Cube_Set_Pixel(i,0,j,RED);
Cube_Set_Pixel(i,7,j,RED);
}
}
if ((x == 1 || x == 4)&&(i > 1 && i < 7)) {
for (j = 1; j < 7; j++) {
Cube_Set_Pixel(i,j,1,YELLOW);
Cube_Set_Pixel(i,j,6,YELLOW);
Cube_Set_Pixel(i,1,j,YELLOW);
Cube_Set_Pixel(i,6,j,YELLOW);
}
}
if ((x == 2 || x == 4)&&(i > 2 && i < 6)) {
for (j = 2; j < 6; j++) {
Cube_Set_Pixel(i,j,2,GREEN);
Cube_Set_Pixel(i,j,5,GREEN);
Cube_Set_Pixel(i,2,j,GREEN);
Cube_Set_Pixel(i,5,j,GREEN);
}
}
}
Delay_MS(delay_ms);
}
}
}
 
void Animation_Double_Rotation(int iterations, int delay_ms) {
Cube_Clear();
int i,x,y,z;
for (z = 0; z < 3; z++) {
switch (z % 3) {
case 0:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,RED);
Cube_Set_Pixel(y,1,1,RED);
Cube_Set_Pixel(y,2,2,RED);
Cube_Set_Pixel(y,3,3,RED);
Cube_Set_Pixel(y,4,4,RED);
Cube_Set_Pixel(y,5,5,RED);
Cube_Set_Pixel(y,6,6,RED);
Cube_Set_Pixel(y,7,7,RED);
}
break;
case 1:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,GREEN);
Cube_Set_Pixel(y,1,1,GREEN);
Cube_Set_Pixel(y,2,2,GREEN);
Cube_Set_Pixel(y,3,3,GREEN);
Cube_Set_Pixel(y,4,4,GREEN);
Cube_Set_Pixel(y,5,5,GREEN);
Cube_Set_Pixel(y,6,6,GREEN);
Cube_Set_Pixel(y,7,7,GREEN);
}
break;
case 2:
for (y = 0; y < CUBE_LAYER_COUNT; y++) {
Cube_Set_Pixel(y,0,0,BLUE);
Cube_Set_Pixel(y,1,1,BLUE);
Cube_Set_Pixel(y,2,2,BLUE);
Cube_Set_Pixel(y,3,3,BLUE);
Cube_Set_Pixel(y,4,4,BLUE);
Cube_Set_Pixel(y,5,5,BLUE);
Cube_Set_Pixel(y,6,6,BLUE);
Cube_Set_Pixel(y,7,7,BLUE);
}
break;
}
 
for (i = 0; i < iterations; i++) {
for (x = 0; x < 28; x++) {
Delay_MS(delay_ms);
Cube_Rotate(0);
}
}
}
}
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/Makefile-default.mk
44,14 → 44,20
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
 
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=main.c SPI1.c TIMER5.c CUBE.c PWM2.c BTN.c TIMER4.c UART1.c SPI4.c ANIMATIONS.c
 
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.o ${OBJECTDIR}/SPI1.o ${OBJECTDIR}/TIMER5.o ${OBJECTDIR}/CUBE.o ${OBJECTDIR}/PWM2.o ${OBJECTDIR}/BTN.o ${OBJECTDIR}/TIMER4.o ${OBJECTDIR}/UART1.o
POSSIBLE_DEPFILES=${OBJECTDIR}/main.o.d ${OBJECTDIR}/SPI1.o.d ${OBJECTDIR}/TIMER5.o.d ${OBJECTDIR}/CUBE.o.d ${OBJECTDIR}/PWM2.o.d ${OBJECTDIR}/BTN.o.d ${OBJECTDIR}/TIMER4.o.d ${OBJECTDIR}/UART1.o.d
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.o ${OBJECTDIR}/SPI1.o ${OBJECTDIR}/TIMER5.o ${OBJECTDIR}/CUBE.o ${OBJECTDIR}/PWM2.o ${OBJECTDIR}/BTN.o ${OBJECTDIR}/TIMER4.o ${OBJECTDIR}/UART1.o ${OBJECTDIR}/SPI4.o ${OBJECTDIR}/ANIMATIONS.o
POSSIBLE_DEPFILES=${OBJECTDIR}/main.o.d ${OBJECTDIR}/SPI1.o.d ${OBJECTDIR}/TIMER5.o.d ${OBJECTDIR}/CUBE.o.d ${OBJECTDIR}/PWM2.o.d ${OBJECTDIR}/BTN.o.d ${OBJECTDIR}/TIMER4.o.d ${OBJECTDIR}/UART1.o.d ${OBJECTDIR}/SPI4.o.d ${OBJECTDIR}/ANIMATIONS.o.d
 
# Object Files
OBJECTFILES=${OBJECTDIR}/main.o ${OBJECTDIR}/SPI1.o ${OBJECTDIR}/TIMER5.o ${OBJECTDIR}/CUBE.o ${OBJECTDIR}/PWM2.o ${OBJECTDIR}/BTN.o ${OBJECTDIR}/TIMER4.o ${OBJECTDIR}/UART1.o
OBJECTFILES=${OBJECTDIR}/main.o ${OBJECTDIR}/SPI1.o ${OBJECTDIR}/TIMER5.o ${OBJECTDIR}/CUBE.o ${OBJECTDIR}/PWM2.o ${OBJECTDIR}/BTN.o ${OBJECTDIR}/TIMER4.o ${OBJECTDIR}/UART1.o ${OBJECTDIR}/SPI4.o ${OBJECTDIR}/ANIMATIONS.o
 
# Source Files
SOURCEFILES=main.c SPI1.c TIMER5.c CUBE.c PWM2.c BTN.c TIMER4.c UART1.c SPI4.c ANIMATIONS.c
 
 
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
88,84 → 94,124
${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
@${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c
${OBJECTDIR}/SPI1.o: SPI1.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/SPI1.o.d
@${RM} ${OBJECTDIR}/SPI1.o
@${FIXDEPS} "${OBJECTDIR}/SPI1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/SPI1.o.d" -o ${OBJECTDIR}/SPI1.o SPI1.c
${OBJECTDIR}/TIMER5.o: TIMER5.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/TIMER5.o.d
@${RM} ${OBJECTDIR}/TIMER5.o
@${FIXDEPS} "${OBJECTDIR}/TIMER5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/TIMER5.o.d" -o ${OBJECTDIR}/TIMER5.o TIMER5.c
${OBJECTDIR}/CUBE.o: CUBE.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/CUBE.o.d
@${RM} ${OBJECTDIR}/CUBE.o
@${FIXDEPS} "${OBJECTDIR}/CUBE.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/CUBE.o.d" -o ${OBJECTDIR}/CUBE.o CUBE.c
${OBJECTDIR}/PWM2.o: PWM2.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/PWM2.o.d
@${RM} ${OBJECTDIR}/PWM2.o
@${FIXDEPS} "${OBJECTDIR}/PWM2.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/PWM2.o.d" -o ${OBJECTDIR}/PWM2.o PWM2.c
${OBJECTDIR}/BTN.o: BTN.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/BTN.o.d
@${RM} ${OBJECTDIR}/BTN.o
@${FIXDEPS} "${OBJECTDIR}/BTN.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/BTN.o.d" -o ${OBJECTDIR}/BTN.o BTN.c
${OBJECTDIR}/TIMER4.o: TIMER4.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/TIMER4.o.d
@${RM} ${OBJECTDIR}/TIMER4.o
@${FIXDEPS} "${OBJECTDIR}/TIMER4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/TIMER4.o.d" -o ${OBJECTDIR}/TIMER4.o TIMER4.c
${OBJECTDIR}/UART1.o: UART1.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/UART1.o.d
@${RM} ${OBJECTDIR}/UART1.o
@${FIXDEPS} "${OBJECTDIR}/UART1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/UART1.o.d" -o ${OBJECTDIR}/UART1.o UART1.c
${OBJECTDIR}/SPI4.o: SPI4.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/SPI4.o.d
@${RM} ${OBJECTDIR}/SPI4.o
@${FIXDEPS} "${OBJECTDIR}/SPI4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/SPI4.o.d" -o ${OBJECTDIR}/SPI4.o SPI4.c
${OBJECTDIR}/ANIMATIONS.o: ANIMATIONS.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/ANIMATIONS.o.d
@${RM} ${OBJECTDIR}/ANIMATIONS.o
@${FIXDEPS} "${OBJECTDIR}/ANIMATIONS.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/ANIMATIONS.o.d" -o ${OBJECTDIR}/ANIMATIONS.o ANIMATIONS.c
else
${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
@${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c
${OBJECTDIR}/SPI1.o: SPI1.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/SPI1.o.d
@${RM} ${OBJECTDIR}/SPI1.o
@${FIXDEPS} "${OBJECTDIR}/SPI1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/SPI1.o.d" -o ${OBJECTDIR}/SPI1.o SPI1.c
${OBJECTDIR}/TIMER5.o: TIMER5.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/TIMER5.o.d
@${RM} ${OBJECTDIR}/TIMER5.o
@${FIXDEPS} "${OBJECTDIR}/TIMER5.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/TIMER5.o.d" -o ${OBJECTDIR}/TIMER5.o TIMER5.c
${OBJECTDIR}/CUBE.o: CUBE.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/CUBE.o.d
@${RM} ${OBJECTDIR}/CUBE.o
@${FIXDEPS} "${OBJECTDIR}/CUBE.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/CUBE.o.d" -o ${OBJECTDIR}/CUBE.o CUBE.c
${OBJECTDIR}/PWM2.o: PWM2.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/PWM2.o.d
@${RM} ${OBJECTDIR}/PWM2.o
@${FIXDEPS} "${OBJECTDIR}/PWM2.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/PWM2.o.d" -o ${OBJECTDIR}/PWM2.o PWM2.c
${OBJECTDIR}/BTN.o: BTN.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/BTN.o.d
@${RM} ${OBJECTDIR}/BTN.o
@${FIXDEPS} "${OBJECTDIR}/BTN.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/BTN.o.d" -o ${OBJECTDIR}/BTN.o BTN.c
${OBJECTDIR}/TIMER4.o: TIMER4.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/TIMER4.o.d
@${RM} ${OBJECTDIR}/TIMER4.o
@${FIXDEPS} "${OBJECTDIR}/TIMER4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/TIMER4.o.d" -o ${OBJECTDIR}/TIMER4.o TIMER4.c
${OBJECTDIR}/UART1.o: UART1.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/UART1.o.d
@${RM} ${OBJECTDIR}/UART1.o
@${FIXDEPS} "${OBJECTDIR}/UART1.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/UART1.o.d" -o ${OBJECTDIR}/UART1.o UART1.c
${OBJECTDIR}/SPI4.o: SPI4.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/SPI4.o.d
@${RM} ${OBJECTDIR}/SPI4.o
@${FIXDEPS} "${OBJECTDIR}/SPI4.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/SPI4.o.d" -o ${OBJECTDIR}/SPI4.o SPI4.c
${OBJECTDIR}/ANIMATIONS.o: ANIMATIONS.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${OBJECTDIR}
@${RM} ${OBJECTDIR}/ANIMATIONS.o.d
@${RM} ${OBJECTDIR}/ANIMATIONS.o
@${FIXDEPS} "${OBJECTDIR}/ANIMATIONS.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -O1 -funroll-loops -MMD -MF "${OBJECTDIR}/ANIMATIONS.o.d" -o ${OBJECTDIR}/ANIMATIONS.o ANIMATIONS.c
endif
 
# ------------------------------------------------------------------------------------
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/Makefile-genesis.properties
1,8 → 1,8
#
#Mon Aug 12 23:04:12 EDT 2013
default.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=6b4fa04caf3910c7c3a4666b1aea8c5c
default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\xc32\\v1.20\\bin
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=415494acd195d89b2f6d7a36797a5ab4
default.languagetoolchain.version=1.20
#Wed Nov 13 12:09:13 EST 2013
default.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=a7430524a414be59f5ce2a8f8797db6d
default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\xc32\\v1.21\\bin
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=0d2b1469ad71adb787c711a416386331
default.languagetoolchain.version=1.21
host.platform=windows
conf.ids=default
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/Makefile-local-default.mk
19,19 → 19,19
# Adding MPLAB X bin directory to path.
PATH:=C:/Program Files (x86)/Microchip/MPLABX/mplab_ide/mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="C:\Program Files (x86)\Microchip\MPLABX\sys\java\jre1.6.0_32-windows-x64\java-windows/bin/"
MP_JAVA_PATH="C:\Program Files (x86)\Microchip\MPLABX\sys\java\jre1.7.0_17/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="C:\Program Files (x86)\Microchip\xc32\v1.20\bin\xc32-gcc.exe"
MP_CPPC="C:\Program Files (x86)\Microchip\xc32\v1.20\bin\xc32-g++.exe"
MP_CC="C:\Program Files (x86)\Microchip\xc32\v1.21\bin\xc32-gcc.exe"
MP_CPPC="C:\Program Files (x86)\Microchip\xc32\v1.21\bin\xc32-g++.exe"
# MP_BC is not defined
MP_AS="C:\Program Files (x86)\Microchip\xc32\v1.20\bin\xc32-as.exe"
MP_LD="C:\Program Files (x86)\Microchip\xc32\v1.20\bin\xc32-ld.exe"
MP_AR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin\xc32-ar.exe"
MP_AS="C:\Program Files (x86)\Microchip\xc32\v1.21\bin\xc32-as.exe"
MP_LD="C:\Program Files (x86)\Microchip\xc32\v1.21\bin\xc32-ld.exe"
MP_AR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin\xc32-ar.exe"
DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files (x86)/Microchip/MPLABX/mplab_ide/mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin"
MP_CPPC_DIR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin"
MP_CC_DIR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin"
MP_CPPC_DIR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin"
# MP_BC_DIR is not defined
MP_AS_DIR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin"
MP_LD_DIR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin"
MP_AR_DIR="C:\Program Files (x86)\Microchip\xc32\v1.20\bin"
MP_AS_DIR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin"
MP_LD_DIR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin"
MP_AR_DIR="C:\Program Files (x86)\Microchip\xc32\v1.21\bin"
# MP_BC_DIR is not defined
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/configurations.xml
13,6 → 13,8
<itemPath>TIMER4.h</itemPath>
<itemPath>glcdfont.h</itemPath>
<itemPath>UART1.h</itemPath>
<itemPath>SPI4.h</itemPath>
<itemPath>ANIMATIONS.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
29,6 → 31,8
<itemPath>BTN.c</itemPath>
<itemPath>TIMER4.c</itemPath>
<itemPath>UART1.c</itemPath>
<itemPath>SPI4.c</itemPath>
<itemPath>ANIMATIONS.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
46,7 → 50,7
<targetPluginBoard></targetPluginBoard>
<platformTool>PK3OBPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.20</languageToolchainVersion>
<languageToolchainVersion>1.21</languageToolchainVersion>
<platform>3</platform>
</toolsSet>
<compileType>
164,6 → 168,7
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
<property key="firmware.download.all" value="false"/>
<property key="memories.bootflash" value="false"/>
<property key="memories.configurationmemory" value="false"/>
<property key="memories.eeprom" value="false"/>
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/private/configurations.xml
4,8 → 4,8
<defaultConf>0</defaultConf>
<confs>
<conf name="default" type="2">
<platformToolSN>:=MPLABCommUSB:=04D8:=8108:=0002:=Digilent:=CerebotMX7CK:=D459520:=x:=en</platformToolSN>
<languageToolchainDir>C:\Program Files (x86)\Microchip\xc32\v1.20\bin</languageToolchainDir>
<platformToolSN>:=MPLABCommUSB:=04D8:=8108:=0002:=Digilent:=Cerebot 32MX7:=D370400:=x:=en</platformToolSN>
<languageToolchainDir>C:\Program Files (x86)\Microchip\xc32\v1.21\bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/private/private.xml
1,4 → 1,3
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<?xml version="1.0" encoding="UTF-8"?><project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>
/PIC Stuff/Cerebot_32MX7_LED_Cube/nbproject/project.xml
1,5 → 1,4
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">