Bayside888
Active member
This is a snippet of a program on the 28X2:
The Code below does NOT work -- the output on pin A.2 stays constant. However, if I comment out the line starting with "if junk>50..." then the code works fine to output an increasing voltage on A.2. I tried different things, including a "DirsA" statement, etc., and finally found the problem by pure chance (and about 2 hours). Any ideas?? Thanks
The Code below does NOT work -- the output on pin A.2 stays constant. However, if I comment out the line starting with "if junk>50..." then the code works fine to output an increasing voltage on A.2. I tried different things, including a "DirsA" statement, etc., and finally found the problem by pure chance (and about 2 hours). Any ideas?? Thanks
Code:symbol DAC_pin=W2 symbol counter = W4 symbol junk=W10 start: Wait_loop: for counter = 0 to 5 pause 1000 ;wait for keypress readadc10 A.1,junk ;test for keypress if junk>50 then display ;jump if key pressed, about zero then loop next low a.2 dacsetup %10100000 ;set for A.2, supply volt max, gnd min for counter = 0 to 31 daclevel Counter pause 1500 next counter goto start display: