Toolkit:SDCC 8051 Development System
Location:/bipom/devtools/SDCC/examples/lcd/float
#include <stdio.h> #include <stdarg.h> #include <8052.h> #include <mcs51\bipomlib\types.h> #include <mcs51\bipomlib\bipomlib.h> #include <mcs51\bipomlib\lcd.h> void main() { float num1, num2, result; num1 = 1.25; num2 = 2.5; result = num1 * num2; // Initialize the serial port serinit(CBR_19200); puts( "\rSDCC LCD Float Multiply" ); // Initialize the LCD LCD_Init(); // Write a simple message to the LCD LCD_SetTopLine(); LCD_Printf("MUL %.2f BY %.2f", num1, num2); LCD_SetBottomLine(); LCD_Printf("RESULT: %f", result); puts( "\rDone" ); while(1); }