View previous topic :: View next topic |
Author |
Message |
idris
Joined: 07 Apr 2014 Posts: 16
|
|
Posted: Thu Apr 17, 2014 10:14 am |
|
|
we fixed thanks every one last code here now ı have to understood how work DS18B20 because is not measuring correctly every moment changing on screen
Code: | #include <18F4550.h>
#device ADC=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES PLL1 //No PLL PreScaler
#FUSES CPUDIV4 //System Clock by 4
#FUSES INTHS //Internal Oscillator, HS used by USB
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(int=8000000)
#include <HDM64GS12.c>
#include <graphics.c>
//#use fast_io(a)
unsigned long int bilgi, bilgi1;
float voltaj, sicaklik;
char text[];
void main()
{
setup_psp(PSP_DISABLED);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED | T3_DIV_BY_1);
setup_CCP1(CCP_OFF);
setup_CCP2(CCP_OFF);
set_tris_a(0x01);
setup_adc(adc_clock_div_32);
setup_adc_ports(AN0);
glcd_init(ON);
delay_ms(500);
set_adc_channel(0);
delay_us(20);
while(1)
{
bilgi=read_adc();
delay_ms(10);
voltaj=bilgi
sicaklik=voltaj
delay_ms(20);
sprintf(text,"%5.2f", sicaklik);
glcd_text57(1, 1, text, 1, ON);
delay_ms(10);
glcd_init(ON);
}
} | [/code] |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9466 Location: Greensville,Ontario
|
|
Posted: Thu Apr 17, 2014 10:22 am |
|
|
You do not have any code or driver for the DS18B20 in your posted program! |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 17, 2014 10:26 am |
|
|
He is announcing what he is going to do next. His current code works,
so he will next work on DS18B20. |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9466 Location: Greensville,Ontario
|
|
Posted: Thu Apr 17, 2014 2:50 pm |
|
|
sorry...been a long day...got forklift stuck in mud and this PC decided to go 'funny',sigh....
there are 'drivers' and working code for the DS18b20 in the code library...
hth
jay |
|
 |
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Apr 17, 2014 4:16 pm |
|
|
So Temtronic, you are saying you have a problem with the "driver" for the forklift???
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
 |
|