greencardigan
Senior Member
Hi,
I'm planning to use an 08M to control some 12V fans.
The 08M will read temp from DS18B20 and PWM fans via a FET.
Can anyone provide any comments on my circuit schematic or code.
Thanks,
Brad
I'm planning to use an 08M to control some 12V fans.
The 08M will read temp from DS18B20 and PWM fans via a FET.
Can anyone provide any comments on my circuit schematic or code.
Code:
symbol OFFTEMP = 432 'degrees x 16
symbol ONHALFTEMP = 448 'degrees x 16
symbol ONFULLTEMP = 464 'degrees x 16
symbol TEMP = w0
for b2 = 1 to 4 'flashes led
high 1
pause 20
low 1
pause 200
next
do
high 1 'flashes led on temp read
pause 20
low 1
readtemp 4, TEMP 'TEMP = degrees x 16
if TEMP >= ONFULLTEMP then
pwmout 2,0,0
high 2
else if TEMP >= ONHALFTEMP then
pwmout 2,255,600
else if TEMP <= OFFTEMP then
pwmout 2,0,0
endif
pause 5000
loop
Brad
Attachments
-
36.3 KB Views: 116