??? 04/06/05 12:52 Read: times |
#91106 - BASIC |
Hi everyone , hope am addressing my self to the right forum...
I’m working on a MC’s based card as a DATA LOGGER, using a 8052 based Microcontroller, with Basic interpreter on board, the board/card is connected to PC via RS232, the program work but not like should, I have a little problem in writing the code, the program runs as follows: 1- getting data 2- monitoring it on LCD 3- in case interrupt(done by a switch), send data to PC. 4- And go on… The third paragraph is done (by means of software) via DO….WHILE loop as follows: 1 P=0 10 TIME=0 : CLOCK 1 : ONTIME T,1000 : DO 20 WHILE TIME<10 30 DO 40 ONEX1 6000 50 WHILE P=0 : END 1000 AN=S 1100 W=ANALOG 1200 IF W>=5 THEN GOSUB 2000 ELSE GOTO 3000 1500 ONTIME TIME+T,1000 1700 RETI 2000 XBY(I)=SDAT 2100 dl=5*W/255 2150 FL=0 2155 ADR1=0F800H 2160 XBY(ADR1)=1 2200 XBY(ADR1)=080H 2250 UO 1 : PRINT "INPUT",S,"=",dl : UO 0 2300 XBY(ADR1)=0A8H 2350 UO 1 : RDATE 1 : RTIME 1 : UO 0 2600 I=I+1 2700 RETURN 3000 PRINT” INPUT = 0”,CR 3100 GOTO 1000 6000 PRINT "INT", CR 6507 Q=Q+1 6510 FOR V=1 TO 10 6520 PRINT "INPUT",S,"=",dl 6525 PRINT " ",V 6528 PRINT "---------------------------------------", CR 6530 NEXT V 6535 PRINT "interrupt No. :",R 6550 RETI its working, but if the interrupt is activated it goes to the subroutine 6000 and yes it prints the input value but the last one for 10 times, I need it to print the last 10 values or more, not to print the last input value for 10 times. Any help would be appreciated. |
Topic | Author | Date |
BASIC | 01/01/70 00:00 | |
Array ? | 01/01/70 00:00 | |
Basic Interpreter? | 01/01/70 00:00 | |
SEARCH ! | 01/01/70 00:00 | |
Ok![]() | 01/01/70 00:00 |