Endless Paradigm

Full Version: BASIC and PIC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The story is as follows:

For school I have to write a program in BASIC to run on a PIC chip. I've chosen to write a program that controls a railway crossing. One of the features of the system is that it counts how many trains have passed over the crossing. When the counter reaches 1000 it will turn on an output warning that the crossing needs maintenance.

My problem is:

How the hell do I program it to check if the counter has reached 1000. I've worked out how to add 1 to the counter for every train that's passed, and how to reset the counter when an imaginary maintenance man comes and presses a button, but I can't work out how to check the number in the memory address allocated to the counter.

Anyone? Does anyone here even know BASIC?


PS the PIC chip is a 16C84 (DATASHEET)
umm my computing teacher would probably cast me to stone if I even looked at basic :3
long time since i did stuff like this.. mhh
get the counter-value into the accumulator first, then subtract 1000 from it..
then theres the conditional "jump zero" » counter is 1000

that's the main idea, hope i got you right
Wow... I don't even remember what BASIC looks like...
BASIC?  From the looks of the spec shit, you're doing something fairly low level...
ZiNgA BuRgA Wrote:BASIC?  From the looks of the spec shit, you're doing something fairly low level...

Yes this is low level. To get full marks all wee need to do is include a sequence, a time delay and a counter. It's simple. It's just having to think like the chip thinks while I'm programming it that's difficult. You forget just how simple it is and try and make it do things that it can't do...


Mythos Wrote:get the counter-value into the accumulator first, then subtract 1000 from it..
then theres the conditional "jump zero" » counter is 1000

That's crazy... So crazy it just might work...

* PSPkiller goes and gets his coding hat...
PSPkiller Wrote:* PSPkiller goes and gets his coding hat...

ive lost mine, has anyone seen it?
dedat Wrote:
PSPkiller Wrote:* PSPkiller goes and gets his coding hat...

ive lost mine, has anyone seen it?

i haz it ... shi- doesn't work for me >:(
Reference URL's