Getting back to BASIC


Getting back to BASIC

It was fun getting reacquainted with BASIC and BASICtools for the People Counter. Most recently been hacking at YAML, TWIG and PHP. Languages I only know enough to be dangerous in. Was doing that to handle some of the tweaks to these webpages and to the other websites I am supporting.

It was good to work on the LPC1114 as it is the most limited of our ARM boards, but had enough to get the job done.

Part of the problem was to save a log of the instances, which required writes to Flash. Dusted off the example for IAP calls in the blog, that used a couple inline ASM statements. Had to see where Flash was free so the Code page in BASICtools showed that 0x5000 and 0x6000 sectors were free.

That's 8K, but there is only 2K RAM available, so limited the log to 64 entries and wrote them out to the Flash for each group of those.

The BASICtools variable dump was useful, as it gave better insight into why my code wasn't doing what I expected. Way back when TA'ing students, my standard answer to "why did the computer do that?" was, "well that's what you told it to do". Seeing the actual variable values helped me see why what I told it to do was wrong.

Bouncing around different languages, I find myself having to check for the proper syntax. So poking around the BASIC helpfiles, uncovered one broken link to a schematic. Fixed that and a few related others.

While it could be more polished, the people sensor is far enough along to deploy.

Here is the code in Notepad++ formatting

Previous Next