-------------------------------------- -- "Pocket oscilloscope -- Used in the "Universal Instrument" -------------------------------------- system Logg global sd run doshow ts nlogg col tshift tstart erase anal knob aarea area[3000] exec 0/initd/show getcmd makelogg ana extprocess initd from (GrafB.mpp) ---------------------------------- process getcmd antal = 12000 butt4 = 20 butt3 = 21 butt2 = 22 butt1 = 23 sw0 = 24 t1ms = 80000 t1s = 80000000 dblue =%0011100000000000 begin par <<2 +48 ->aarea antal ->nlogg t1ms >>1 ->ts 0 ->tshift ( sw0 )setin -- 0 ->tstart :loop if(( sw0 )inpin =0){ knob *antal >>12 ->tstart } if(( butt4 )inpin =0){ 1 ->run } if(( butt3 )inpin =0){ 1 ->erase } if(( butt2 )inpin =0){ ( butt2 , 1 , )change } if(( butt1 )inpin =0){ ( butt1 , 1 - , )change } t1ms wait A:loop ---------------------------------------------------- -- ( ibutt , d , )change ---------------------------------------------------- function change begin tshift +arg1 ->tshift :hold if(( arg0 )inpin =0):hold t1ms wait if(( arg0 )inpin =0):hold return load from(std.mpo) *setin *inpin *mult \ ----------------------------------------------------- process makelogg a i begin :hold if(run =0):hold aarea ->a nlogg ->i :wloop anal >>4 &255 ; wrbyte accu,a +1,a< ts wait NEXT(i):wloop 1 ->doshow 0 ->run A:hold \ ---------------------------------- process show st = 75 ix iy y yel = %0000011111111111 dblue =%0011100000000000 a begin )gra.connect :loop if(erase #0){ ( dblue )gra.clear 0 ->erase } 160 ->ix :imloop ix *st >>tshift +tstart +aarea ->a ; rdbyte accu,a >>1 +3 ->iy ( 160 -ix , 128 -iy , yel , )gra.paint NEXT(ix):imloop A:loop load from (GrafB.mpo) *gra.connect *gra.paint *gra.clear load from (std.mpo) *mul \ ----------------------------------- process ana begin )adc.init :loop ( 0 )adc.get ->knob ( 1 )adc.get ->anal A:loop load from(adc.mpo) *adc.init *adc.get \