My programme so far

craig008

New Member
as you know i am designing a cool coputer mod, i have most of the circuit built on bread boards and have been beta testing parts of the porgramme on that, no the reason for this post is to try and see wht you guys think of it the circuit has been developed a little and i have still got some work to do one the sertxd commands to allow for the LCD display on pin 6 - feed back or bad is always helpful

Code:
start:
	peek $c1,b9
	peek $c2,b10
	if b9 = 0 then gosub B_9
	if b10 = 0 then gosub B_10

main:
	let b4 = 0
	let b3 = 0
	readtemp12 0,w6
	let w6 = w6*10/16
	let b1 = w6/10
	let b2 = w6//16
	sertxd ("Temp: ",#b1,44,#b2,13,10)
	
temp:
	if pin6 = 1 and pin7 = 1 then temp_select
	pause 500

	if b1 < b9 then gosub P_1
	if b1 > b9 and b1 < b10 then gosub P_2
	if b1 > b10 then gosub panic
	if b0 = 255 then down
	
up:
	pwmout 1, 63, b0
	let b3 = b3 + 1
	if b3 = 32 then LED_1
	if b0 = 255 then main
	let b0 = b0 + 1
	goto up
	
down:

	pwmout 1, 63, b0
	let b3 = b3 + 1
	if b0 = 0 then main
	if b3 = 32 then LED_2
	let b0 = b0 - 1

	goto down
	

LED_1:
	let b4 = b4 + 1	
	let pins = %00000001
	let b3 = 0
	if b4 = 1 then up
	let pins = %00000011
	let b3 = 0
	if b4 = 2 then up
	let pins = %00000111 
	let b3 = 0
	if b4 = 3 then up
	let pins = %00001111
	let b3 = 0
	if b4 = 4 then up
	let pins = %00011111
	let b3 = 0
	if b4 = 5 then up
	let pins = %00111111
	let b3 = 0
	if b4 = 6 then up
	let pins = %01111111
	let b3 = 0
	if b4 = 7 then up
	let pins = %11111111
	let b3 = 0
	goto up
	
LED_2:
	let b4 = b4 + 1	
	let pins = %00000000
	let b3 = 0
	if b4 = 8 then down
	let pins = %00000001
	let b3 = 0
	if b4 = 7 then down
	let pins = %00000011 
	let b3 = 0
	if b4 = 6 then down
	let pins = %00000111
	let b3 = 0
	if b4 = 5 then down
	let pins = %00001111
	let b3 = 0
	if b4 = 4 then down
	let pins = %00011111
	let b3 = 0
	if b4 = 3 then down
	let pins = %00111111
	let b3 = 0
	if b4 = 2 then down
	let pins = %01111111
	goto down

P_1:
	pause 1000
	return
	
P_2:
	pause 150
	return
	
panic:
	let pins = %11111111
	pwmout 1, 63, 255
	readtemp12 0,w6
	let w6 = w6*10/16
	let b1 = w6/10
	let b2 = w6//16
	sertxd ("Panic Stations, its getting a little hot: ",#b1,44,#b2,13,10)
	let pins = %00000000
	pwmout 1,62, 0
	pause 500
	if b1 > 35 then panic
	return

temp_select:
	pause 500
	sertxd ("Normal Op Temp")
	if pin6 = 1 then gosub B_9up
	if pin7 = 1 then gosub B_9down
	if pin6 = 1 and pin7 = 1 then temp_select1
	goto temp_select
	
	
temp_select1:
	pause 500
	sertxd ("Upper Op Temp")
	if pin6 = 1 then gosub B_10up
	if pin7 = 1 then gosub B_10down
	if pin6 = 0 and pin7 = 0 then temp_select1
	poke $c0,b9
	poke $c1,b10

	goto temp
	
B_9up:
	let b9 = b9 + 1
	return
	
B_9down:
	let b9 = b9 - 1
	return
	
B_10up:
	let b10 = b10 + 1
	return
	
B_10down:
	let b10 = b10 - 1
	return
	
B_9:
	let b9 = 30
	poke $c1,b9
	return
	
B_10:
	let b10 = 35
	poke $c2,b10
	return
________
Top Portable Vaporizer
 
Last edited:
Top