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º¹¤ÍÁ¾ÇÔ àµÍÃ
#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º¹¤ÍÁ¾ÇÔ àµÍÃ