Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
#include "lcd.h"
#define LCD_BACKLIGHT PIOB_SODR_P20
#define SW_1 PIOB_SODR_P24
#define SW_2 PIOB_SODR_P25
#define UP PIOA_SODR_P7
#define OK PIOA_SODR_P8
#define LEFT PIOA_SODR_P9
#define RIGHT PIOA_SODR_P14
#define DOWN PIOA_SODR_P15
#define AUDIO_OUT PIOB_SODR_P19
__attribute__ ((section(".fast")))
void delay(int n) //procedura opoznienia
{
volatile int i;
for(i=3000*n;i>0;i--)
{
__asm__("nop");
}
}
int main()
{
PMC_PCER=PMC_PCER_PIOB; //wlaczenie urzadzenia we/wy PIOB
PMC_PCER=PMC_PCER_PIOA; //wlaczenie urzadzenia we/wy PIOA
PIOB_OER=LCD_BACKLIGHT | AUDIO_OUT; //OUTPUT ENABLE
PIOB_PER=LCD_BACKLIGHT | AUDIO_OUT; //PIO ENABLE
InitLCD(); //inicjalizacja LCD
LCDSettings(); //ustawienie LCD
LCDClearScreen();
//LCDWrite130x130bmp(); //wyswietlenie BMP (zdef w pliku bmp.h)
LCDPutStr("TESTTt",20,20,LARGE,WHITE,BLACK) ;
while(1)
{
if ((PIOB_PDSR & SW_1)==0)
{
//PIOB_SODR|=LCD_BACKLIGHT; //ustawienie 1
PIOB_SODR|=AUDIO_OUT;
LCDClearScreen(); //wyczyszczenie
LCDPutStr("SW_1",120,10,LARGE,WHITE,BLACK) ; //wyświetlanie SW_1 w lewym dolnym rogu
delay(1);
PIOB_CODR|=AUDIO_OUT;
delay(1);
}
if ((PIOB_PDSR & SW_2)==0)
{
//PIOB_CODR|=LCD_BACKLIGHT; //ustawienie 0
PIOB_SODR|=AUDIO_OUT;
LCDClearScreen();
LCDPutStr("SW_2",120,90,LARGE,WHITE,BLACK);
delay(5);
PIOB_CODR|=AUDIO_OUT;
delay(5);
}
if ((PIOB_PDSR & UP)==0)
{
//PIOB_SODR|=LCD_BACKLIGHT; //ustawienie 1
PIOB_SODR|=AUDIO_OUT;
LCDClearScreen();
LCDPutStr("UP",10,56,LARGE,WHITE,BLACK) ;
delay(1);
PIOB_CODR|=AUDIO_OUT;
delay(1);
}
if ((PIOB_PDSR & DOWN)==0)
{
//PIOB_SODR|=LCD_BACKLIGHT; //ustawienie 1
PIOB_SODR|=AUDIO_OUT;
LCDClearScreen();
LCDPutStr("DOWN",100,56,LARGE,WHITE,BLACK) ;
delay(1);
PIOB_CODR|=AUDIO_OUT;
delay(1);
}
if ((PIOB_PDSR & LEFT)==0)
{
//PIOB_SODR|=LCD_BACKLIGHT; //ustawienie 1
PIOB_SODR|=AUDIO_OUT;
LCDClearScreen();
LCDPutStr("LEFT",56,10,LARGE,WHITE,BLACK) ;
delay(1);
PIOB_CODR|=AUDIO_OUT;
delay(1);
}
}
return 0;
}
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team