My opinion : MUST connect the LED trough resistor (R=U/I ; where U=5V and I depend on LED colour) ...
My opinion : MUST connect the LED trough resistor (R=U/I ; where U=5V and I depend on LED colour) ...
it is strange because most of the times PICs can directly drive loads until 100mA. The leds get something like 10mA or less. The thing is that it looks like some pulses coming up from the pin. Can i test the PIN without any load on it with an oscilloscope? IF i have pulses then can we identify what the problem should be?
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.
Fratello,
i have changed your code a little bit, only a very simple thing in order to have two outputs.
instead of this
Code:If V < TargetTemp - Hyst then ' Below Target temperature - Hysteresis PORTA.2=1 ' Activate Warm Output PORTA.3=0 ' Deactivate Cold Output EndIf If V > TargetTemp + Hyst then ' Above Target temperature + Hysteresis PORTA.2=0 ' Deactivate Warm output PORTA.3=1 ' Activate Cold Output EndIf
i used this
and now i have two outputs. Very simple change but useful.Code:If V < TargetTemp - Hyst then ' Below Target temperature - Hysteresis PORTA.2=1 ' Activate Warm Output EndIf If V > TargetTemp + Hyst then ' Above Target temperature + Hysteresis PORTA.2=0 ' Deactivate Warm output EndIf If V2 < TargetTemp - Hyst then ' Below Target temperature - Hysteresis PORTA.3=0 ' Deactivate Cold Output EndIf If V2 > TargetTemp + Hyst then ' Above Target temperature + Hysteresis PORTA.3=1 ' Activate Cold Output EndIf
Regards,
I used to manipulate the ports directly, but once I had a problem and suspicion have fallen on the technique among other things.
So, I now only use HIGH and LOW commands even if these eat a little program memory just to be sure.
If your code is small enough to fit in one page then you probably can use direct port control.
Ioannis
Bookmarks