Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:49 23 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Program stopped working.

Author Message
Worm

Newbie

Joined: 30/06/2011
Location: New Zealand
Posts: 38
Posted: 06:58am 15 Aug 2011
Copy link to clipboard 
Print this post

I have been trying out the FRIDGE.BAS program which was working all good but now it has stopped working properly. It is still running, eg. logging data onto the SD card, but wont show any info on the screen like it used to do. I have compaired the program that is loaded into the Maximite to the one shown in Silicon chip May. They are identicle, so why has the program stopped working properly?? Can anybody tell me why this has happened?
There's no such thing as a free lunch.
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 07:32am 15 Aug 2011
Copy link to clipboard 
Print this post

Worm

can you give a few more details for example

have you rebooted (turned off and turned back on)?

can you run anything else? does it show up on screen?

is the screen still working plugged in ok etc

Keith
The more we know, the more we know we don't know !
 
Worm

Newbie

Joined: 30/06/2011
Location: New Zealand
Posts: 38
Posted: 08:00am 15 Aug 2011
Copy link to clipboard 
Print this post

Thanks Keith for replying. I dont recall how it stopped working properly. What I have tried is rebooting it. Reloading a fresh copy of FRIDGE.BAS off internet. I can run other programs. I have even tried using another Maximite. What I get on the screen is the entry of the program. I then enter "run" and hit enter. This starts the program running but still showing the program on screen rather than T1 T2 T3 etc. as it used to do. To stop the program running, I use "Ctrl & C" I always enter "new" before running a program. Im stumped and dont know where to go from here.

Kevin
There's no such thing as a free lunch.
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 08:12am 15 Aug 2011
Copy link to clipboard 
Print this post

Hi,

I have just had a look at the FRIDGE.BAS program (from Geoff's web site - library v1.4).

The program does NOT write to the screen - it only writes to the FRIDGE.XLS file on the SD Card.

So it would appear that the program is executing correctly now - if it was displaying data on the screen previously then it was not working correctly then!

Regards

Gerard (vk3cg/vk3grs)
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 08:14am 15 Aug 2011
Copy link to clipboard 
Print this post

Hi Kevin
You said you entered "NEW" before running the program. NEW clears any program from memory, though you may still see part if it listed on the screen. Are you loading the fridge program, entering NEW, and then entering RUN?

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Worm

Newbie

Joined: 30/06/2011
Location: New Zealand
Posts: 38
Posted: 08:19am 15 Aug 2011
Copy link to clipboard 
Print this post

Thats weird then. I must be loosing my marbles or there is a different version of the FRIDGE.BAS program that both writes to the screen and SD card??

Kevin
There's no such thing as a free lunch.
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 08:52am 15 Aug 2011
Copy link to clipboard 
Print this post

Hi.

Here is a modified FRIDGE.BAS that writes to both the SD card and the screen:


100 FOR i = 1 TO 5 : SETPIN i, 1 : NEXT i
110 SETPIN 10, 2
120 OPEN "FRIDGE.XLS" FOR OUTPUT AS #1
130 PRINT #1, "DATE", "TIME", "T1", "T2", "T3", "T4", "T5", "DOOR"
140 CLOSE #1
142 CLS : PRINT " DATE"; TAB(16); "TIME"; TAB(27); "T1"; TAB(36); "T2"; TAB(45); "T3"; TAB(54); "T4"; TAB(63); "T5"; TAB(71); "DOOR"
150 DO
160 OPEN "FRIDGE.XLS" FOR APPEND AS #1
170 PRINT #1, DATE$, TIME$,;
172 LOCATE 0,12 : PRINT DATE$; TAB(14); TIME$; TAB(25);
180 FOR i = 1 TO 5
190 t = (PIN(i) / 3.3 * 3.29 - 2.73) * 100
200 PRINT #1, FORMAT$(t, "%4.1f"),;
202 PRINT FORMAT$(t, "%4.1f"); TAB((i * 9) + 25);
210 NEXT i
220 IF PIN(10) THEN
222 PRINT #1, "CLOSED" : PRINT "CLOSED"
224 ELSE
226 PRINT #1, "OPEN" : PRINT " OPEN"
228 ENDIF
230 CLOSE #1
240 PAUSE 2000
250 LOOP


Before copying the code, ensure your browser window is wide enough to ensure the lines of code do not wrap.

Regards

Gerard (vk3cg/vk3grs)
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 09:18am 15 Aug 2011
Copy link to clipboard 
Print this post

Or if you prefer a scrolling display:


100 FOR i = 1 TO 5 : SETPIN i, 1 : NEXT i
110 SETPIN 10, 2
120 OPEN "FRIDGE.XLS" FOR OUTPUT AS #1
130 PRINT #1, "DATE", "TIME", "T1", "T2", "T3", "T4", "T5", "DOOR"
140 CLOSE #1
142 CLS : PRINT " DATE"; TAB(16); "TIME"; TAB(27); "T1"; TAB(36); "T2"; TAB(45); "T3"; TAB(54); "T4"; TAB(63); "T5"; TAB(70); " DOOR "
150 DO
160 OPEN "FRIDGE.XLS" FOR APPEND AS #1
170 PRINT #1, DATE$, TIME$,;
172 loc = loc + 12 : if loc = 432 then loc = 420
178 LOCATE 0,loc : PRINT DATE$; TAB(14); TIME$; TAB(25);
180 FOR i = 1 TO 5
190 t = (PIN(i) / 3.3 * 3.29 - 2.73) * 100
200 PRINT #1, FORMAT$(t, "%4.1f"),;
202 PRINT FORMAT$(t, "%4.1f"); TAB((i * 9) + 25);
210 NEXT i
220 IF PIN(10) THEN
222 PRINT #1, "CLOSED" : PRINT "CLOSED"
224 ELSE
226 PRINT #1, "OPEN" : PRINT " OPEN "
228 ENDIF
229 LOCATE 0,0 : PRINT " DATE"; TAB(16); "TIME"; TAB(27); "T1"; TAB(36); "T2"; TAB(45); "T3"; TAB(54); "T4"; TAB(63); "T5"; TAB(70); " DOOR "
230 CLOSE #1
240 PAUSE 2000
250 LOOP


Regards

Gerard (vk3cg/vk3grs)
 
Worm

Newbie

Joined: 30/06/2011
Location: New Zealand
Posts: 38
Posted: 09:41am 15 Aug 2011
Copy link to clipboard 
Print this post

Cool. Thanks Gerard. Just what I wanted, but strange how thats what I had before?? I must admit that I had been playing around with the program. I will look back and see what I may have done.

Kevin


There's no such thing as a free lunch.
 
Worm

Newbie

Joined: 30/06/2011
Location: New Zealand
Posts: 38
Posted: 09:51am 15 Aug 2011
Copy link to clipboard 
Print this post

For Glenn. I have learnt that it pays to always enter "new" before entering a program so that any previous program does not interfer with the new program.

As a sugestion, is it possable to have a section on the forum for beginers Tips.

Kevin


There's no such thing as a free lunch.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024