Page 166 - ipst-microbox_manual
P. 166
l ¤Á‹Ù Í× ÍҌ §Í§Ô áÅÐ㪧Œ Ò¹¡Å͋ §ÊÁͧ¡Å IPST-MicroBOX

#include

unsigned char text=0; // for save text from PC

void main()

{

lcd("Please press key"); // Show on LCD

uart("Please press any key or 'A' to Exit");

// Show text on hyper terminal

uart_putc(0x0a); // line feed

uart_putc(0x0d); // Enter

while(text!='A') // Loop until key 'A' Press

{

text=uart_getkey(); // Read data from PC Serial

if (text!=0) // data = 0 ?

{

lcd("#c"); // Clear LCD

lcd("You Press Key %c",text); // show text on LCD 1st line

uart("You Press key %c",text); // show text on Teminal

uart_putc(0x0a); // Enter

uart_putc(0x0d);

sleep(100); // delay

}

}

uart("Good Bye"); // if Press 'A'

lcd("#nGood Bye"); // show text

while(1); // and end program

}

â»Ãá¡ÃÁ·ÕèK4-2â»Ãá¡ÃÁÀÒÉÒCÊÒí ËÃºÑ ¡ÒÃÊÍ×è ÊÒâ͌ ÁÅÙ ¡ºÑ ¤ÍÁ¾ÇÔ àµÍü ҋ ¹·Ò§¾Íõ ͹¡Ø ÃÁRS-232
¢Í§á¼§Ç§¨ÃMicroBOXâ´ÂãªáŒ ¼§Ç§¨ÃDisplay-ioáÅмšÒ÷Òí §Ò¹¢Í§â»Ãá¡ÃÁ·áÕè Ê´§¼Ò‹ ¹Ë¹ÒŒ µÒ‹ §Hyper
Terminalº¹¤ÍÁ¾ÇÔ àµÍÏ
   161   162   163   164   165   166   167   168   169   170