Hi there i am trying to make a cool mod for my PC. basically it will fade LEDs on the inside of the case and light 8 LEDs as a bar, the speed of the fading should be controlled by the temp of the case while also dispaying the temp on an LCD, any ideas on te best way of doing this would be great. I will be using the PSu to supply power.
CODE:
main:
let b0 = 0
let b1 = 0
let b2 = 0
up_1:
let b2 = 0
pause 500 'will be temp reading
up:
let b1 = b1 + 1
pwmout 1 , 99, b0 'PWM up for internal LEDs
let b0 = b0 + 1
if b0 = 255 then goto down_1
if b1 = 32 then LED
goto up
LED: 'LED bar increase
sertxd(#b0,44,#b1,44,#b2,44,13,10) 'connect to LCD
let b1 = 0
let b2 = b2 + 1
let pins = %10000000
if b2 = 1 then up
let pins = %11000000
if b2 = 2 then up
let pins = %11100000
if b2 = 3 then up
let pins = %11110000
if b2 = 4 then up
let pins = %11111000
if b2 = 5 then up
let pins = %11111100
if b2 = 6 then up
let pins = %11111110
if b2 = 7 then up
let pins = %11111111
goto up
down_1:
let b2 = 0
let b1 = 0
pause 500 'will be temp reading
down:
let b1 = b1 + 1
pwmout 1 , 99, b0 'PWM down for internal LEDs
let b0 = b0 - 1
if b0 = 10 then goto up_1
if b1 = 32 then LED1
goto down
LED1: 'LED bar decrease
sertxd(#b0,44,#b1,44,#b2,44,13,10) 'connect to LCD
let b1 = 0
let b2 = b2 + 1
let pins = %00000000
if b2 = 7 then down
let pins = %10000000
if b2 = 6 then down
let pins = %11000000
if b2 = 5 then down
let pins = %11100000
if b2 = 4 then down
let pins = %11111000
if b2 = 3 then down
let pins = %11111100
if b2 = 2 then down
let pins = %11111110
if b2 = 1 then down
let pins = %11111111
goto down
Another question is how many LEDs can i connect to PWM before i need to connect extra hardware, many thanks
________
Plymouth expresso
CODE:
main:
let b0 = 0
let b1 = 0
let b2 = 0
up_1:
let b2 = 0
pause 500 'will be temp reading
up:
let b1 = b1 + 1
pwmout 1 , 99, b0 'PWM up for internal LEDs
let b0 = b0 + 1
if b0 = 255 then goto down_1
if b1 = 32 then LED
goto up
LED: 'LED bar increase
sertxd(#b0,44,#b1,44,#b2,44,13,10) 'connect to LCD
let b1 = 0
let b2 = b2 + 1
let pins = %10000000
if b2 = 1 then up
let pins = %11000000
if b2 = 2 then up
let pins = %11100000
if b2 = 3 then up
let pins = %11110000
if b2 = 4 then up
let pins = %11111000
if b2 = 5 then up
let pins = %11111100
if b2 = 6 then up
let pins = %11111110
if b2 = 7 then up
let pins = %11111111
goto up
down_1:
let b2 = 0
let b1 = 0
pause 500 'will be temp reading
down:
let b1 = b1 + 1
pwmout 1 , 99, b0 'PWM down for internal LEDs
let b0 = b0 - 1
if b0 = 10 then goto up_1
if b1 = 32 then LED1
goto down
LED1: 'LED bar decrease
sertxd(#b0,44,#b1,44,#b2,44,13,10) 'connect to LCD
let b1 = 0
let b2 = b2 + 1
let pins = %00000000
if b2 = 7 then down
let pins = %10000000
if b2 = 6 then down
let pins = %11000000
if b2 = 5 then down
let pins = %11100000
if b2 = 4 then down
let pins = %11111000
if b2 = 3 then down
let pins = %11111100
if b2 = 2 then down
let pins = %11111110
if b2 = 1 then down
let pins = %11111111
goto down
Another question is how many LEDs can i connect to PWM before i need to connect extra hardware, many thanks
________
Plymouth expresso
Last edited: