Commit 9967ca67 authored by Lars Vössing's avatar Lars Vössing
Browse files

Laufschrift von unten nach oben

parent 40c25065
......@@ -13,9 +13,13 @@
#include <avr/interrupt.h>
#include "8x8_horizontal_MSB_1.h"
//#include "8x8_vertikal_MSB_1.h"
volatile uint8_t current_char;
volatile char text[]= "Hi Patrizia!\03\01";
volatile char text[]= "Hallo Patrizia! Wie gehts?\03\01";
volatile char display_content[8];
uint8_t bytet_text[800];
//ISR(TIMER1_COMPA_vect){
// static uint8_t i = 0;
......@@ -42,14 +46,17 @@ ISR(TIMER0_OVF_vect){
if(i < 6){
PORTB &= ~0x03;
PORTD = 1 << (i +2);
PORTD = 1 << (i + 2);
}
else{
PORTD &= ~0xCF;
PORTB &= ~0x03;
PORTB |= 1 << ( i - 6);
}
tmp = pgm_read_byte(&(font[current_char][i]));
// tmp = pgm_read_byte(&(font[current_char][i]));
tmp = display_content[i];
PORTC = (tmp & 0x3F);
PORTB &= ~0x0C;
......@@ -85,7 +92,8 @@ void uart_init(void)
int main(){
_delay_ms(600);
uint8_t i, ii;
uint8_t i, n;
uint8_t ii = 0;
DDRC = 0x3F;
DDRD = 0xFC;
......@@ -101,11 +109,19 @@ int main(){
sei();
// uart_init();
for(i = 0; i < sizeof(text); i ++){
current_char = text[i];
for(n = 0; n < 8; n ++){
bytet_text[i * 8 + n] = pgm_read_byte(&(font[current_char][n]));
}
}
while(1){
while(ii < sizeof(text)){
current_char = text[ii];
while(ii < sizeof(text)* 8 - 8){
for(i = 0; i < 8; i ++){
display_content[i] = bytet_text[ii + i];
}
ii ++;
_delay_ms(500);
_delay_ms(100);
}
ii = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment