Error in Control BANNED

MiniPOV4 and previous versions

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
BigAl
 
Posts: 3
Joined: Mon Nov 24, 2008 10:38 am

Error in Control BANNED

Post by BigAl »

I am a sucker for blinkie lights and I have enjoyed messing with the Minipov3 but I am not that well versed in programming. I have 2 questions:
1. Can I plug the pov directly to the serial port on the back of my laptop without a caple?
2. When I am in the command screen I receive an error message that ‘make’ is not a recognized command when I try to run "make minipov-program" :?: . Any suggestions?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Error in Control BANNED

Post by adafruit »

1. yes
2. install winavr (see the instructions)

BigAl
 
Posts: 3
Joined: Mon Nov 24, 2008 10:38 am

Re: Error in Control BANNED

Post by BigAl »

Ok, I thought that I had downloaded that but apparently I did not save it right. Thanks, it works great!
Now when I went to modify the display with new text only 5 LED's light up continuously. I used 120 lines for 3 words.
Could that be to much?
Here is the file:
#include <avr/io.h> // this contains all the IO port definitions
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <util/delay.h>

void delay_ms( uint16_t milliseconds)
{
for( ; milliseconds > 0; milliseconds--)
{
_delay_ms( 1);
}
}

#define TIMER1_PRESCALE_1 1
#define TIMER1_PRESCALE_8 2
#define TIMER1_PRESCALE_64 3
#define TIMER1_PRESCALE_256 4
#define TIMER1_PRESCALE_1024 5

// We use these macros because binary constants arent always supported. ugh.
#define HEX__(n) 0x##n##UL
#define B8__(x) ((x&0x0000000FLU)?1:0) \
+((x&0x000000F0LU)?2:0) \
+((x&0x00000F00LU)?4:0) \
+((x&0x0000F000LU)?8:0) \
+((x&0x000F0000LU)?16:0) \
+((x&0x00F00000LU)?32:0) \
+((x&0x0F000000LU)?64:0) \
+((x&0xF0000000LU)?128:0)
#define B8(d) ((unsigned char)B8__(HEX__(d)))

const static int image[] = {
B8(00000000),
B8(01111100),
B8(10000010),
B8(10000010),
B8(10100010),
B8(01100110),
B8(00100000),
B8(00000000),
B8(01111100),
B8(10000010),
B8(10000010),
B8(10000010),
B8(01111100),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(10000010),
B8(11111110),
B8(10000010),
B8(10000000),
B8(11100000),
B8(00000000),
B8(10000000),
B8(11000000),
B8(10111010),
B8(00100110),
B8(10111000),
B8(11000000),
B8(10000000),
B8(10000010),
B8(11111110),
B8(10000010),
B8(10000010),
B8(01000100),
B8(00111000),
B8(00000000),
B8(00000010),
B8(00000110),
B8(10001010),
B8(11110000),
B8(10001010),
B8(00000110),
B8(00000010),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000010),
B8(01111110),
B8(10000010),
B8(01111000),
B8(10000010),
B8(01111110),
B8(00000010),
B8(10000000),
B8(11000000),
B8(10111010),
B8(00100110),
B8(10111000),
B8(11000000),
B8(10000000),
B8(00000000),
B8(10000010),
B8(11111110),
B8(10100010),
B8(00100010),
B8(01011100),
B8(10000000),
B8(00000000),
B8(10000010),
B8(11111110),
B8(10100010),
B8(00100010),
B8(01011100),
B8(10000000),
B8(00000000),
B8(10000010),
B8(10000010),
B8(11111110),
B8(10000010),
B8(10000010),
B8(00000000),
B8(00000000),
B8(01111100),
B8(10000010),
B8(10000010),
B8(10000010),
B8(01111100),
B8(00000000),
B8(00000000),
B8(10000010),
B8(11111110),
B8(10100010),
B8(00100010),
B8(01011100),
B8(10000000),
B8(00000000),
B8(11001100),
B8(10010010),
B8(10010010),
B8(10010100),
B8(01100110),
B8(00000000),
B8(00000000),
};

#define NUM_ELEM(x) (sizeof (x) / sizeof (*(x)))
int imagesize = NUM_ELEM(image);


// this function is called when timer1 compare matches OCR1A
uint8_t j = 0;
SIGNAL( SIG_TIMER1_COMPA ) {
if (j >= imagesize)
j = 0;

PORTB = image[j];

j++;
}

int main(void) {

DDRB = 0xFF; // set all 8 pins on port B to outputs

/*
the frequency of the interrupt overflow is determined by the
prescaler and overflow value.
freq = clock_frequency / ( 2 * prescaler * overflow_val)
where prescaler can be 1, 8, 64, 256, or 1024
clock_freq is 8MHz
and overflow_val is 16bit

the overflow value is placed in OCR1A, the prescale is set in TCCR1B
so for example:
A good POV frequency is around 400Hz
desired freq = 400Hz
clock freq = 8MHz
8MHz / (400Hz * 2) = 10000
since 10000 is less than 655536 (largest 16 bit number)
OCR1A = 10000 and the prescale is 1
*/

TCCR1B = (1 << WGM12) | TIMER1_PRESCALE_1;
OCR1A = (uint16_t)10000;

TIMSK |= 1 << OCIE1A; // Output Compare Interrupt Enable (timer 1, OCR1A)

sei(); // Set Enable Interrupts

while (1);
}

BigAl
 
Posts: 3
Joined: Mon Nov 24, 2008 10:38 am

Re: Error in Control BANNED

Post by BigAl »

I reloaded all original data and now I have no blinking lights.
Any thoughts?
Thank you for the trouble.

The_Don125
 
Posts: 373
Joined: Tue Mar 06, 2007 11:51 pm

Re: Error in Control BANNED

Post by The_Don125 »

For long messages like that, use the file large_image.hex (or something to that effect). It seems long messages like that need the other file.

Locked
Please be positive and constructive with your questions and comments.

Return to “MiniPOV”