Page 1 of 1

school project "Traffic Light"

Posted: Thu Mar 01, 2012 9:49 pm
by Jordy101091
Hi all,

I'm doing a school assignment, here we must write a program for controlling a traffic light.
Now if a want to test (simulate) my program in flowcode it doesn't work as aspected. I have setup a interupt routine that keep track of the time, how long each action should take.

But the problem is, the interupt macro never gets called. I dont know what the problem is. Is it me or is it a bug I dont know.
Maybe you can help me out.

Regards Jordy

PS. program is attached.

Re: school project "Traffic Light"

Posted: Thu Mar 01, 2012 10:08 pm
by medelec35
Hi Jordy

To get Timer0 to work you, will need to change the properties of Timer0 interrupt from 'Transition on T0CKI pin'
To 'Internal clock (CLKO)'

When T0CKI is selected then interrupt will only start counting when external logic level on pin RA4 changes.

Unfortunately TOCKI default is set for external clock, so there will be a few people caught out this way.

Martin

Re: school project "Traffic Light"

Posted: Thu Mar 01, 2012 10:21 pm
by Jordy101091
Thanks Martin
I Will have look at it tomorrow.
I Will let you knie something.

Regards jordy

Re: school project "Traffic Light"

Posted: Thu Mar 01, 2012 11:44 pm
by dazz
jordy, i got kinda bored here so i made a new panel for your code , makes the panel easier to understand (i think you drive on the wrong side of thre road ;) ) had to zip the file as the forum doesnt allow panel uploads

Re: school project "Traffic Light"

Posted: Thu Mar 01, 2012 11:57 pm
by medelec35
Hi Zaz, Not sure if you are aware that you can change the look of components on the control panel with custom images.
Yuo can ether get some images from here:
http://www.matrixmultimedia.com/article.php?a=418

Or create your own.

Very nice look what you have done with the panel. :)

Martin