You are reading a single comment by @Harry_T and its replies. Click here to read the full conversation.
  • Hi Gordon,
    Sorry, I'm not too familiar with the nightly build concept - I downloaded on the 30th Jan if that helps.

    An example of the delays I built in were as follows:

    function toggle3() {
    	LCD.clear();
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
    	LCD.setColor(0, 0, 0);
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
    	LCD.fillRect(1, 1, 320, 240);
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
    	LCD.setColor(0, 1, 0);
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
    	PotPos = analogRead(C0);
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
        LCD.drawString(PotPos, 230, 210);
        digitalPulse(A2,1,50);
    	digitalPulse(A2,0,50);
    
    	setInterval(function() {
          LCD.clear();
          digitalPulse(A2,1,20);
          digitalPulse(A2,0,20);
          PotPos = analogRead(C0);
          digitalPulse(A2,1,20);
          digitalPulse(A2,0,20);
          LCD.drawString(PotPos, 200, 210);
    	}, 200);
    
    	digitalWrite(LED2,p=!p);
    }
    
    var l = false;
    var p = false;
    var PotPos = 0.1;
    
    setInterval("digitalWrite(LED1,l=!l);",800);
    
    setWatch(toggle3, E5, {repeat: true, edge:'falling'});
    

    Whether or not this program worked was dependent on the digitalPulse duration, and was often not repeatable. I found mathematical operations were less fussy than instructions involving the LCD.

    Introducing a SetInterval made things more complicated, and sometimes seemed to want a couple of digitalPulses at the end of the loop, and sometimes didn't. I'd have to evaluate one step at a time and see if it crashed.

About

Avatar for Harry_T @Harry_T started