So the second variant it's better ?!
So the second variant it's better ?!
Hi Fratello,
Well your complaint was noise interfered with data when you switch the device in /out. If you leave it "in circuit" all the time it eliminates that possibility. By using a separate input to detect a switch the noise is confined there. You might also consider using a pin that has an interrupt available, so it changes in "real time", instead of waiting for a loop to get around to it.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
So...This is correct ?
Thanks for support !Code:... If portA.7= 1 then valoare=temperature semn=sign else valoare=temperature2 semn=sign2 Endif Gosub Selectie Gosub Display ' B for Common CATOD;without B for Common ANOD Goto Main '====================================================================================== Selectie : IF semn ="-" then DIGIT_3="-" else DIGIT_3=" " ENDIF IF valoare DIG 2 = 0 THEN DIGIT_2 = " " ELSE DIGIT_2 = valoare dig 2 ENDIF DIGIT_1 = valoare dig 1 DIGIT_0 = valoare dig 0 RETURN '====================================================================================== Display: ' For Common ANOD for i=0 to 4 TEMP = DIGIT_3 : gosub segments COMMON_3 = 1 : PAUSE 1 : COMMON_3 = 0 TEMP = DIGIT_2 : GOSUB segments COMMON_2 = 1 : PAUSE 1 : COMMON_2 = 0 TEMP = DIGIT_1 : GOSUB segments COMMON_1 = 1 : DP = 0 : PAUSE 1 : COMMON_1 = 0 : DP = 1 TEMP = DIGIT_0 : GOSUB segments COMMON_0 = 1 : PAUSE 1 : COMMON_0 = 0 next i RETURN![]()
One of my DS18B20 it's about 4 meters from PIC. What is the smaller value of resistor used for this sensor ? Can I try with 1k ? Thanks !
I have used 15m cable and pull up resistor 680 ohms. Resistor value depends greatly on the capacity of cable. And the capacity of the cable depends on the length.
With 5 meters of cable from PIC to DS18B20, no need to decrease value of R (still 4k7). Thanks for support !
...but, in some cases, I decrease the value to 3k9...for the same lenght of cables !
Bookmarks