Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define F_CPU 1000000UL
- #include <avr/io.h>
- #include <util/delay.h>
- #include <stdlib.h>
- #include "HD44780.c"
- #define SW_L (1<<PA4)
- #define SW_L_ON !(PINA & SW_L)
- #define SW_P (1<<PA5)
- #define SW_P_ON !(PINA & SW_P)
- void Draw_Main(char src[2][16][1]){
- for (short int row = 0; row < 2; row++)
- {
- for (short int col = 0; col < 16; col++)
- {
- LCD_GoTo(col, row); // x, y
- LCD_WriteText(&src[row][col]);
- }
- }
- }
- int main(void)
- {
- // 2 - wiersze, 16 - kolumny, 1- dlugosc znaku (czyli maksymalnie 1)
- char ekran[2][16][1] = {
- { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6'},
- { 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F', 'T', 'E', 'S', 'T'}
- };
- LCD_Initalize();
- LCD_Clear();
- DDRA &= ~(SW_L | SW_P);
- PORTA |= (SW_L | SW_P);
- while(1)
- {
- Draw_Main(ekran);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement