     pair[1]=high;   
   }
   
-  SlowPWM(Ticks low, Ticks high, bool andStart=false){
+  SoftPWM(Ticks low, Ticks high, bool andStart=false){
     setCycle(low,high);
     if(andStart){
       onDone();

};

 
class SlowPWMdemo: public SlowPWM {
public:
  using SlowPWM::SlowPWM;
  //it is a bad idea to do this much in an isr ...
  virtual void onToggle(bool on){
    if(!on){
      dbg.print("\nSlowpwm:");
    } else {
      dbg.print(" to ");
    }
    dbg.print(millis());
  }
    
} spwmdemo(250,750,true);

RegisterTimer(spwmdemo);


const InputPin<6, LOW> button1;
const InputPin<7, LOW> button2;

#include "motorshield1.h"

#include "timerservice.h"

#include "retriggerablemonostable.h"

RetriggerableMonostable lamprey(red, Ticks(350));
RegisterTimer(lamprey);
void triggerPulse(){
  lamprey.trigger();
}

#define Show(arg) dbg.print("\n" #arg ":");dbg.print(arg)

#include "interruptPin.h"
void greenLight() {
  green = button2;
  RX=green;
  if(button2){
    M2=1*(1-button1);//go forward unless other button is pressed in which case stop
  }
  dbg.print("G");
  dbg.print(millis());
}
const InterruptPin<greenLight, button2.number, CHANGE> greenirq;

void redLight(){
  red = button1;
  TX=red;
  if(button1){
    M2=-1*(1-button2);//see greenLight();
  }
  dbg.print("R");
}
const InterruptPin<redLight, button1.number, CHANGE> redirq;
//const InterruptPin<triggerPulse,button1.number,FALLING> redirq;
