FloatToStr in Proteus

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
_zag_
Posts: 2
Joined: 06 Mar 2008 13:34

FloatToStr in Proteus

#1 Post by _zag_ » 29 May 2008 20:28

Hi for ALL!!
Is anybody try use program with "floattostr" and simulate it in proteus?
My program not work :( ....

Code: Select all

program Proteus_First;

var Data:array[4]of real;
    Data_Str:array[4] of string[21];
  //Data_Str:array[4] of array[21]of char; -not work

begin
 // WDTOFF
 WDTCR:=$07;
 
 Lcd_Init(PORTD, 7, 6, PORTC, LCD_HI_NIBBLE);
 Lcd_Cmd(LCD_CURSOR_OFF);

 Lcd_Out(1,1,'FLOATTOSTR+PROTEUS');

 Data[0]:=-8.2;
 Data[1]:=3344.0;
 Data[2]:=5566.0;
 Data[3]:=7.88;


 Floattostr(Data[0], Data_Str[0]);
 Floattostr(Data[1], Data_Str[1]);
 Floattostr(Data[2], Data_Str[2]);
 Floattostr(Data[3], Data_Str[3]);

 Lcd_Out(1,1,Data_Str[0]);
 Lcd_Out(2,1,Data_Str[1]);
 Lcd_Out(3,1,Data_Str[2]);
 Lcd_Out(4,1,Data_Str[3]);

while true do
 begin
 end;
end.
LCD initialization, write string, and when must be floattostr, MCU is reseting :?:

Post Reply

Return to “mikroPascal for AVR General”