Package avrora.sim

Examples of avrora.sim.FiniteStateMachine


    public LightSensor(AtmelMicrocontroller m, int adcChannel, String onPin, String powPin) {
        mcu = m;
        channel = adcChannel;
        mcu.getPin(onPin).connect(new OnPin());
        mcu.getPin(powPin).connect(new PowerPin());
        fsm = new FiniteStateMachine(mcu.getClockDomain().getMainClock(), 0, names, 0);
        ADC adc = (ADC)mcu.getDevice("adc");
        adc.connectADCInput(new ADCInput(), channel);
    }
View Full Code Here


//    cc2420.updateActiveFrequency();
      return (int) cc2420.getFrequency();
  }

  public boolean isRadioOn() {
      FiniteStateMachine fsm = cc2420.getFiniteStateMachine();
      /* based on reading the source code it seems that the fsm state = 3 means on */
      //System.out.println("COOJA: cc2420 FSM: " + fsm.getCurrentState());
      return fsm.getCurrentState() >= 3;
  }
View Full Code Here

TOP

Related Classes of avrora.sim.FiniteStateMachine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.