I am creating a project for my GCSE where children put a shape into a cutout eg circle can i use the setint to act as a edge trigger on one or more of the inputs. for example the child puts in a cirlce, the rest of the program runs, however if they leave the spahe in the program keeps running. on and on and on...
So can i use the setint to act as the edge trigger so if they leave the shape in the programe will ignore it the second time, until the shape has been removed (in my case turn from 0 (on) back to 1 (off)) and it will keep going exculding more shapes as they leave them in.
To help heres my current Pic programme so you can have more of an idea as to what my project does..
i2cslave $c4,i2cfast,i2cbyte
readi2c 1, (b2)
debug b2
main:
GoSub prc_WELCOME
GoTo label_21
label_21:
If pin0 = 0 Then label_22
If pin1 = 0 Then label_23
If pin2 = 0 Then label_24
If pin5 = 0 Then label_25
GoTo label_21
label_22:
serout 7,4,(254,1)
pause 1000
writei2c 0, (0,0,5,2,"Triangle T. R. I. A. n. G. L. e. Triangle.",0)
serout 7,4,("A Triangle"
writei2c 0, (64)
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("T"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TR"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRI"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRIA"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRIAN"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRIANG"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRIANGL"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("TRIANGLE"
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("A Triangle"
pause 2000
serout 7,4,(254,1)
GoTo label_26
label_23:
serout 7,4,(254,1)
pause 1000
writei2c 0, (0,0,5,2,"Circle. C. I. R. C. L. e. Circle. ",0)
serout 7,4,("A Circle"
writei2c 0,(64)
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("C"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("CI"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("CIR"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("CIRC"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("CIRCL"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("CIRCLE"
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("A Circle"
pause 2000
serout 7,4,(254,1)
GoTo label_26
label_24:
serout 7,4,(254,1)
pause 1000
writei2c 0, (0,0,5,2,"Square. s. q. U. A. R. e. Square.",0)
serout 7,4,("A Square"
writei2c 0,(64)
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("S"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("SQ"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("SQU"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("SQUA"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("SQUAR"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("SQUARE"
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("A Square"
pause 2000
serout 7,4,(254,1)
GoTo label_26
label_25:
serout 7,4,(254,1)
pause 1000
writei2c 0, (0,0,5,2,"Rectangle. R. e. C. T. A. n. G. L. e. Rectangle.",0)
serout 7,4,("A Rectangle"
writei2c 0,(64)
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("R"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RE"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("REC"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECT"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECTA"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECTAN"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECTANG"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECTANGL"
pause 1000
serout 7,4,(254,1)
pause 500
serout 7,4,("RECTANGLE"
pause 2000
serout 7,4,(254,1)
pause 500
serout 7,4,("A Rectangle"
pause 2000
serout 7,4,(254,1)
pause 1000
GoTo label_26
label_26:
End
prc_WELCOME:
serout 7,4,(254,1)
pause 1000
writei2c 0, (0,0,5,5,"Please place A shape",0)
serout 7,4,("Please place a"
serout 7,4,(254,192)
serout 7,4,("Shape!"
writei2c 0,(64)
pause 4000
serout 7,4,(254,1)
pause 1000
serout 7,4,("Please place a"
serout 7,4,(254,192)
serout 7,4,("Shape!"
pause 4000
serout 7,4,(254,1)
pause 500
Return
at label 26 it terminates, so they would have to place a reset switch on pin 1 to start the program again, however, like i said if they leave the sahpe in the program repeats itself..
I know its confusing but any help will be Great, and it doesn't matter if you can't....
Thankyou,
Owen