// // This chop accepts as input channels containing single sample // pulses. It outputs corresponding channels which switch from zero to one // and back as they encounter each pulse (note the nasty E^2 run time...) // #include #pragma help "This chop accepts as input channels containing single sample pulses. It outputs corresponding channels which switch from zero to one and back as they encounter each pulse (note the nasty E^2 run time...)" chop pulsetoggle() { int val = 0; // initial value is always zero int indx = S; for(indx=S; indx<=I; indx++) { if(chinput(0,C,indx)>.5) { val = 1 - val; } // switch at every pulse } V = val; }