Sonsivri

Electronics => Pic Basic Languages => Topic started by: KhaledLotfy on June 09, 2008, 06:04:57 18:04



Title: Array Of Float
Post by: KhaledLotfy on June 09, 2008, 06:04:57 18:04
Hi All;
do any one have an idea how to implement an array of type float in Proton compilier;
Regards
Khaled


Title: Re: Array Of Float
Post by: strat on June 17, 2008, 09:22:17 09:22
Code:
Device = 16F877
XTAL=4
Dim val1 As Float
Dim val2 As Float

Dim intarray[10] As Word
Dim floatarray[10] As Word

Declare LCD_INTERFACE 4
Declare LCD_DTPIN PORTB.4
Declare LCD_ENPIN PORTB.3
'DECLARE LCD_RWPIN PORTB.2
Declare LCD_RSPIN PORTB.1


val1=23.342

intarray[1]=val1
floatarray[1]=(val1-intarray[1])*1000
Print At 1,1,#intarray[1],",",#floatarray[1]

loop:
  DelayMS 100
GoTo loop


This sample dosn't work if you use PIC16F84. Proton doesn't compile if you choose device = 16f84. I used only one byte long array but you can use long size arrays in your programs. 


Title: Re: Array Of Float
Post by: KhaledLotfy on June 22, 2008, 11:06:53 11:06
I will try it,
I'm using PIC18F452,
this task is  simple in MiKroBasic,or MiKroC,but with Proton,one must play around;
I must Give thanks for your help Start;
Regards