Chetan patil
/
LCD
LED blink
Fork of HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include"mbed.h" 00002 00003 BusOut m(p9,p10,p11,p12,p13,p14,p15,p16); 00004 DigitalOut Rs(p19); 00005 DigitalOut e(p20); 00006 int main () 00007 { 00008 char x[10]="SHRIKEE"; 00009 char Y[10]="CHETAN"; 00010 int i; 00011 Rs=0; 00012 wait(0.5); 00013 m=0x38; 00014 e=1; 00015 wait(0.5); 00016 e=0; 00017 wait(0.5); 00018 m=0x06; 00019 00020 e=1; 00021 wait(0.5); 00022 e=0; 00023 wait(0.5); 00024 m=0x0e; 00025 00026 e=1; 00027 wait(0.5); 00028 e=0; 00029 wait(0.5); 00030 m=0x01; 00031 00032 e=1; 00033 wait(0.5); 00034 e=0; 00035 wait(0.5); 00036 m=0x80; 00037 00038 e=1; 00039 wait(0.5); 00040 e=0; 00041 wait(0.5); 00042 Rs=1; 00043 wait(0.5); 00044 i=0; 00045 while (x[i]!='\0') 00046 { 00047 00048 m=x[i]; 00049 e=1; 00050 wait(0.5); 00051 e=0; 00052 wait(0.5); 00053 i++; 00054 00055 } 00056 m=0xc0; 00057 e=1; 00058 wait(0.5); 00059 e=0; 00060 wait(0.5); 00061 00062 while (Y[i]!='\0') 00063 { 00064 00065 m=y[i]; 00066 e=1; 00067 wait(0.5); 00068 e=0; 00069 wait(0.5); 00070 i++; 00071 00072 } 00073 }
Generated on Fri Jul 22 2022 22:47:05 by 1.7.2