:: مهندس متواجد ::
تاريخ التسجيل: Jun 2013
المشاركات: 82
|
|
نشاط [ محمد55555 ]
قوة السمعة:0
|
|
29-11-2018, 09:32 AM
المشاركة 6
|
|
#include "library/nokia3310_lcd.c"
#include "img/eletorial.c"
const char* text = "www.facebook.com/eng.mhatab";
void main() {
int counter ;
TRISA = 0x00;
TRISB = 0x00;
CMCON = 0x07;
PORTA = 0x00;
PORTB = 0x00;
nokia_lcd_init();
while (1) {
nokia_lcd_image(eletorial_bmp, 3);
delay_char = 200 ;
nokia_lcd_cmd(WRITE_HORIZONTAL_MODE); // horizontal mode from left to right
nokia_lcd_clear(); // clear the screen
//print the string on the display
// 14 char in line -------------|-------------|=============|-------------|-------------|=============|
nokia_lcd_out_message(" Eng.Mohammed S. Abu Hatab My Channel : www.YouTube.com/EngMHatab");
DelayMs(2000);
delay_char= 10 ;//10ms
nokia_lcd_clear(); // clear the screen
nokia_lcd_goto_offset_char(2,1); // row 2 , column 1
nokia_lcd_out_message(text);
nokia_lcd_cmd(DISPLAY_INVERSE_MODE);
DelayMs(2000);
nokia_lcd_cmd(DISPLAY_NORMAL_MODE);
nokia_lcd_clear(); // clear the screen
nokia_lcd_goto_offset_char(0, 1); // row 0 , col = 1
nokia_lcd_out_message ("Test counter");
nokia_lcd_goto_offset_char(4, 2); // row 4 , col = 2
nokia_lcd_out_message ("Increment");
counter = 0 ;
while(counter < 5){
nokia_lcd_goto_offset_char(2, 2); // row 2 , col = 2
nokia_lcd_out_message (" ");
nokia_lcd_goto_offset_char(2, 6);
nokia_lcd_out_int(counter);
DelayMs(750);
counter++;
}
nokia_lcd_goto_offset_char(4, 2);
nokia_lcd_out_message ("Decrement");
while(counter > -5){
nokia_lcd_goto_offset_char(2, 2);
nokia_lcd_out_message (" ");
nokia_lcd_goto_offset_char(2, 6);
nokia_lcd_out_int(counter);
DelayMs(750);
counter--;
}
nokia_lcd_clear(); // clear the screen
DelayMs(500);
nokia_lcd_goto_offset_char(2,0); // row 2 , column 0
nokia_lcd_out_message(" Thanks for Watching");
DelayMs(2000);
}
}
|