hey guys,
im in need of some help. i have a code here that i found in another thread but its not working like it should iv tried my best to get it to work and got nothing.
please help me fix it
cheers Jordan
im in need of some help. i have a code here that i found in another thread but its not working like it should iv tried my best to get it to work and got nothing.
Code:
#Picaxe 14M2
#no_data
setfreq m4
symbol fan = B.2
symbol temp = B.1
symbol temperature = B0
symbol duty = W1
Inti:
pwmout fan,39,0 'Enable PWM Freq = 25KHz / Duty = 0
Main: 'Main Loop
'-------------------------------------------
pwmout fan,39,159
pause 2000 '1.25sec
pwmout fan,39,0
do
gosub Temp_Loop
pause 1000
loop
'---------- END MAIN ------------------------
Temp_Loop: 'Sub Routine
'--------------------------------------------------
readtemp temp,temperature
select case temperature
case =< 25 : duty = 79
case 25 to 29 : duty = 95
case 30 to 34 : duty = 111
case 35 to 39 : duty = 127
case 40 to 45 : duty = 143
case > 45 : duty = 159
endselect
pwmduty fan,duty 'Change fan speed according to temp
return 'to main
'---------------- End SUB --------------------------
cheers Jordan
Last edited by a moderator: