Permalink
Browse files

Cleanup

  • Loading branch information...
1 parent 1dd7b66 commit 597c8a0bcdba0637d152a640f53f2a3faaa726a1 @tiefpunkt tiefpunkt committed Oct 31, 2011
Showing with 0 additions and 336 deletions.
  1. +0 −153 main.c.old
  2. +0 −183 main.c.volker
View
@@ -1,153 +0,0 @@
-#include <inttypes.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#define DELAY_MS 0
-
-//Row on/off defines to toggle Bit Pins
-// Port D: Pin0 Pin1 Pin2 Pin3 Pin4
-// Row_EN N/A Row0 Row1 Row2
-#define ROWS_ON PORTD &= ~(1<<PD3);
-#define ROWS_OFF PORTD |= (1<<PD3);
-#define ROW0_ON PORTD |= (1<<PD7);
-#define ROW0_OFF PORTD &= ~(1<<PD7);
-#define ROW1_ON PORTD |= (1<<PD6);
-#define ROW1_OFF PORTD &= ~(1<<PD6);
-#define ROW2_ON PORTD |= (1<<PD5);
-#define ROW2_OFF PORTD &= ~(1<<PD5);
-
-// definitions for the Row selection
-#define ROW1 ROW0_OFF ROW1_OFF ROW2_OFF
-#define ROW2 ROW0_OFF ROW1_OFF ROW2_ON
-#define ROW3 ROW0_OFF ROW1_ON ROW2_OFF
-#define ROW4 ROW0_OFF ROW1_ON ROW2_ON
-#define ROW5 ROW0_ON ROW1_OFF ROW2_OFF
-#define ROW6 ROW0_ON ROW1_OFF ROW2_ON
-#define ROW7 ROW0_ON ROW1_ON ROW2_OFF
-#define ROW8 ROW0_ON ROW1_ON ROW2_ON
-
-// definitions for the shift register controls
-#define MR_HI PORTA |= (1<<PA0);
-#define MR_LO PORTA &= ~(1<<PA0);
-#define DATA_HI PORTA |= (1<<PA2);
-#define DATA_LO PORTA &= ~(1<<PA2);
-#define OE_HI PORTA |= (1<<PA4);
-#define OE_LO PORTA &= ~(1<<PA4);
-
-#define SHCP_HI PORTA |= (1<<PA3);
-#define SHCP_LO PORTA &= ~(1<<PA3);
-
-#define STCP_HI PORTA |= (1<<PA1);
-#define STCP_LO PORTA &= ~(1<<PA1);
-
-int main (void){
- DDRA = 0xFF; /* Set our output register to output */
- DDRD = 0xFF;
-
- DATA_HI
- MR_HI
- OE_LO
- ROWS_ON
- SHCP_LO
- STCP_LO
- int rowcount=1;
- int paintcount=0;
- int i;
- int pixels[128] =
- {1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0};
- int pixels2[128] =
- {0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1};
- int pixels3[128] =
- {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
-
- int *pixel1, *pixel2, *pixel_temp;
- pixel1 = &pixels[0]; //pixels
- pixel2 = &pixels2[0]; //pixels2
-
- while(42) {
- switch(rowcount){
- case 1:
- ROW1
- rowcount=2;
- break;
- case 2:
- ROW2
- rowcount=3;
- break;
- case 3:
- ROW3
- rowcount=4;
- break;
- case 4:
- ROW4
- rowcount=5;
- break;
- case 5:
- ROW5
- rowcount=6;
- break;
- case 6:
- ROW6
- rowcount=7;
- break;
- case 7:
- ROW7
- rowcount=8;
- break;
- case 8:
- ROW8
- rowcount=1;
- break;
- }
-
- for(i=0;i<128;i++){
- SHCP_LO
- _delay_ms(DELAY_MS);
- switch(rowcount-1){
- case 0:
- case 1:
- case 2:
- case 3:
- if(*(pixel1+i) == 0){
- DATA_LO
- } else {
- DATA_HI
- }
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- if(*(pixel2+i) == 0){
- DATA_LO
- } else {
- DATA_HI
- }
- break;
- }
- SHCP_HI
- _delay_ms(DELAY_MS);
- }
- STCP_HI
- _delay_ms(DELAY_MS);
- STCP_LO
- _delay_ms(DELAY_MS);
- paintcount++;
- if(paintcount > 1000) {
- paintcount = 0;
- pixel_temp = pixel2;
- pixel2 = pixel1;
- pixel1 = pixel_temp;
- }
- }
-return 0;
-}
-
View
@@ -1,183 +0,0 @@
-#include <inttypes.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#define DELAY_MS 0
-
-//Row on/off defines to toggle Bit Pins
-// Port D: Pin0 Pin1 Pin2 Pin3 Pin4
-// Row_EN N/A Row0 Row1 Row2
-#define ROWS_ON PORTD &= ~(1<<PD3);
-#define ROWS_OFF PORTD |= (1<<PD3);
-#define ROW0_ON PORTD |= (1<<PD7);
-#define ROW0_OFF PORTD &= ~(1<<PD7);
-#define ROW1_ON PORTD |= (1<<PD6);
-#define ROW1_OFF PORTD &= ~(1<<PD6);
-#define ROW2_ON PORTD |= (1<<PD5);
-#define ROW2_OFF PORTD &= ~(1<<PD5);
-
-// definitions for the Row selection
-#define ROW1 ROW0_OFF ROW1_OFF ROW2_OFF
-#define ROW2 ROW0_OFF ROW1_OFF ROW2_ON
-#define ROW3 ROW0_OFF ROW1_ON ROW2_OFF
-#define ROW4 ROW0_OFF ROW1_ON ROW2_ON
-#define ROW5 ROW0_ON ROW1_OFF ROW2_OFF
-#define ROW6 ROW0_ON ROW1_OFF ROW2_ON
-#define ROW7 ROW0_ON ROW1_ON ROW2_OFF
-#define ROW8 ROW0_ON ROW1_ON ROW2_ON
-
-// definitions for the shift register controls
-#define MR_HI PORTA |= (1<<PA0);
-#define MR_LO PORTA &= ~(1<<PA0);
-#define DATA_HI PORTA |= (1<<PA2);
-#define DATA_LO PORTA &= ~(1<<PA2);
-#define OE_HI PORTA |= (1<<PA4);
-#define OE_LO PORTA &= ~(1<<PA4);
-
-#define SHCP_HI PORTA |= (1<<PA3);
-#define SHCP_LO PORTA &= ~(1<<PA3);
-
-#define STCP_HI PORTA |= (1<<PA1);
-#define STCP_LO PORTA &= ~(1<<PA1);
-
-void showframe (char frame[1024]);
-
-int main (void){
- DDRA = 0xFF; /* Set our output register to output */
- DDRD = 0xFF;
-
- DATA_HI
- MR_LO
- MR_HI
- OE_LO
- ROWS_ON
- SHCP_LO
- STCP_LO
- int rowcount=1;
- int paintcount=0;
- int i;
-
- char frame1[1024] =
- {1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0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,0,0,0,1,1,1,1,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0};
-
- char *pixel1, *pixel2, *pixel_temp, *frameToShow, *pframe1, *pframe2, *pframe_temp;
-
- pframe1 = &frame1[0];
- pframe2 = &frame2[0];
- frameToShow = pframe1;
-
- while(42) {
- showframe(frame1);
- }
- return 0;
-}
-
-void showframe (char frame[1024]){
- int i,j;
-
- for(i=0; i<8; i++){
- switch(i){
- case 0:
- ROW1
- break;
- case 1:
- ROW2
- break;
- case 2:
- ROW3
- break;
- case 3:
- ROW4
- break;
- case 4:
- ROW5
- break;
- case 5:
- ROW6
- break;
- case 6:
- ROW7
- break;
- case 7:
- ROW8
- break;
- }
- for(j=127; j>=0; j--){
- SHCP_LO
- if(frame[(128*i)+(j%32)+((j/32)*256)] == 0){
- DATA_LO
- } else {
- DATA_HI
- }
- SHCP_HI
- }
- STCP_HI
- _delay_ms(DELAY_MS);
- STCP_LO
- }
-}
-

0 comments on commit 597c8a0

Please sign in to comment.