rb51_e20

Page 55

Robotics Experiment with MCS-51 microcontroller l 55

â»Ãá¡ÃÁ·Õè A5-1 â»Ãá¡ÃÁÀÒÉÒ C ÊÓËÃѺ·´Åͧ¡ÒÃãªé§Ò¹áÅÐáÊ´§¼Å¢éͤÇÒÁ·Õâè Á´ÙÅ LCD (¨º) led2 = 1; lcd_command(1); lcd_putstr(line1,” beep(); led3 = 0; delay_ms(2000); led3 = 1;

// Turn-off LED at P3.6 // Clear LCD LED P3.7 ON”); // Show message “ LED P3.7 ON” on upper line // Generate beep sound // Turn-on LED at P3.7 // Delay 2 seconds // Turn-off LED at P3.7

} } lcd_command(1); lcd_putstr(line1,” beep(); led3 = 0; delay_ms(2000); led3 = 1;

// Clear LCD LED P3.7 ON”); // Show message “ LED P3.7 ON” on upper line // Generate beep sound // Turn-on LED at P3.7 // Delay 2 seconds // Turn-off LED at P3.7

} }

Listing A3-1 The C program for driving LED, sound and display message at LCD module on the RBX-51AC2 controller board (final)

INNOVATIVE EXPERIMENT


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.