ࡱ>  Root Entry`]MAIN  6RSCOMPSTG1L&>`]`]CONTENTS WG _extentxR WG _extentyport01bit0port10bit1port23bit2port32bit3port45bit4port54bit5"yTlcdsize RSComponent LCDDisplay16F877a,0x2007,0x3f3a O#include <float.h> float radius; float area; float print_temp; float dec_temp;J RSFlowlineMainXXKjv RSStartStopCmdMain RSCommentCmdITo get started with the 32 bit floating point numbers firstly you need to copy the file float.h into the "Flowcode V3/BoostC/Include". The you need to add the piece of code into the supplementary code defines box located in the edit menu. #include <float.h> Variables are defines either in the supplementary code window or a C code block using the following standard: float variable_name; The next thing to do is to add the float.pic16.lib and float.pic18.lib files into the "Flowcode V3/BoostC/Lib" directory. You then include these libraries into the linker by going to chip -> Compiler Options -> Linker / Assembler / Parameters modify the line so that it now contains either float.pic16.lib for pic16 series or float.pic18.lib for pic18 series. The linker property should now look similar to this. -ld "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\lib" libc.pic16.lib flowcode.pic16.lib float.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f" The functions used in this program were all taken from the float.h file. For details on other available functions refer to this file. NOTE: this program will not simulate correctly because it uses C-code icons to perform the floating point calculations. Also, make sure the radius entered is between 0.0 and 72.2, otherwise the 16-bit maths for the Flowcode variables will overflow. RSMacroCallCmdInitialize the LCDStart LCDDisplay(0)0 RSCCodeCmdEnter the radius hereradius = 68.789;  RSLoopCmdLoop1MainXXMain Output the Radius PrintRadius0 Calculate the AreaCalcArea0 Output the Area PrintArea0MainMainCalcAreaXX/Calculate the area of a circle from the radius.II LCDDisplay(0)'.'0 Convert Real part of  RSComponent LCDDisplay16F877a,0x2007,0x3f3a O#include <float.h> float radius; float area; float print_temp; float dec_temp;J RSFlowlineMainXXKjv RSStartStopCmdMain RSCommentCmdITo get started with the 32 bit floating point numbers firstly you need to copy the file float.h into the "Flowcode V3/BoostC/Include". The you need to add the piece of code into the supplementary code defines box located in the edit menu. #include <float.h> Variables are defines either in the supplementary code window or a C code block using the following standard: float variable_name; The next thing to do is to add the float.pic16.lib and float.pic18.lib files into the "Flowcode V3/BoostC/Lib" directory. You then include these libraries into the linker by going to chip -> Compiler Options -> Linker / Assembler / Parameters modify the line so that it now contains either float.pic16.lib for pic16 series or float.pic18.lib for pic18 series. The linker property should now look similar to this. -ld "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\lib" libc.pic16.lib flowcode.pic16.lib float.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f" The functions used in this program were all taken from the float.h file. For details on other available functions refer to this file. NOTE: this program will not simulate correctly because it uses C-code icons to perform the floating point calculations. Also, make sure the radius entered is between 0.0 and 72.2, otherwise the 16-bit maths for the Flowcode variables will overflow. RSMacroCallCmdInitialize the LCDStart LCDDisplay(0)0 RSCCodeCmdEnter the radius hereradius = 68.789;  RSLoopCmdLoop1MainXXMain Output the Radius PrintRadius0 Calculate the AreaCalcArea0 Output the Area PrintArea0MainMainCalcAreaXX/Calculate the area of a circle from the radius.K;  CalcArea X = Radius Squared$area = float32_mul(radius, radius); area = area * PI%area = float32_mul(area, 3.1415927); area = area * 2area = float32_mul(area, 2); CalcArea PrintRadiusXX(Prints the Radius Float value to the LCDKm  PrintFloat Reset Cursor to 0,0Cursor LCDDisplay(0) RSOperand000 Print Radius: PrintString LCDDisplay(0) "Radius: "0 Set the LCD output to Radiusprint_temp = radius; Output the value to the LCD PrintFloat0 PrintFloat PrintAreaXX&Prints the Area float value to the LCDKg  PrintArea Set cursor to 0,1Cursor LCDDisplay(0)010 Print Area: PrintString LCDDisplay(0)"Area: "0 Set the LCD output to Areaprint_temp = area; Output the value to the LCD PrintFloat0 PrintArea PrintFloatXXEPrints a Float Value to the LCD using the float variable "print_temp"Kl?E  PrintFloat Convert Integer part of number7FCV_WHOLE = float32_to_int32_round_to_zero(print_temp); Output Integer part to LCD PrintNumber LCDDisplay(0)whole0 Print Decimal Point PrintASCII LCDDisplay(0)'.'0 Convert Real part of numberdec_temp = float32_from_int32(FCV_WHOLE); dec_temp = float32_sub(print_temp, dec_temp); dec_temp = float32_mul(1000, dec_temp); FCV_REAL = float32_to_int32(dec_temp); Output Real part to LCD PrintNumber LCDDisplay(0)real0 PrintFloatWHOLEVariablewholeREAL;real