eieieieieieieieiieieieieeiieieieieieijfaw;mcchn vdcrw,kh eacet,'n jcdr'lmnhcrl.snj dr[.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lll.cpp Source File

lll.cpp

00001 #include "mbed.h"
00002 #include <string>
00003 
00004 //------------------------------------
00005 // Hyperterminal configuration
00006 // 9600 bauds, 8-bit data, no parity
00007 //------------------------------------
00008 Serial lcd(D8,D2);
00009 Serial pc(USBTX,USBRX);
00010 DigitalOut myled(LED1);
00011 DigitalOut D(USER_BUTTON);
00012 uint8_t x,t;
00013 int y=0;
00014 int a=0;
00015 char *forkong;
00016 char *aaa ;
00017 char *s[50];
00018 void off()
00019 {
00020     for (int  n = 0; n < 3; n++) 
00021     {
00022     lcd.printf("%c",char(uint8_t(255)));
00023   }    
00024     }
00025 void kong()
00026 {
00027     
00028     aaa = strtok (forkong,",");
00029   pc.printf("r.1------------%s------------------\n",aaa);
00030     while (aaa != NULL)
00031   {
00032   
00033     //s[a]=pch;
00034     //printf ("%s\n",s[a]);
00035     aaa = strtok (NULL, ",");
00036     s[0]=aaa;
00037     pc.printf("r.2****************%s*********\n",s[0]);
00038     break;
00039     }
00040 }
00041 int main()
00042 {
00043    while(1)
00044    {
00045        forkong="1,HELLO";
00046        kong();
00047        pc.printf("%c \n",char(forkong[0]));
00048             if(forkong[0]==49)
00049                 {
00050                     lcd.printf("page page1");
00051                     off();
00052                     y=1;
00053                 }
00054    //pc.printf("%c\n",char(forkong[0]));
00055 //   pc.printf("#######################\n");
00056         if(y==1)
00057         {
00058             lcd.printf("t0.txt=\"%s\"",s[0]);
00059             off();
00060             y=2;
00061             }
00062             if(y==2);
00063             {
00064      t = lcd.getc();
00065       pc.printf("%c\n",char(uint8_t(t)));
00066                 y=0;
00067              }
00068         pc.printf("=============\n");
00069         if(y==0)
00070         {
00071             lcd.printf("page page0");
00072             off();
00073             }
00074     }
00075 }