Librerías \ Supervisor

Referencia para la versión de Wiring 1.0 Build 0100+. Si tiene una versión previa, use la referencia incluida con su software. Si encuentra errores o tiene comentarios, no dude en contactarnos.

Clase

Supervisor

Nombre

removeRule()

Ejemplos
#include <Supervisor.h>

int x = 0;

/*
  Define the rule itself
*/
SupervisedRule<int> ledOnFirstTenSeconds(x,checkFirstTen,handleAfterTen);

/*
  Define the rule helpers
*/
//this function will return true the first ten seconds
//when it return false (aka the rule failed) the handler will be called
boolean checkFirstTen(int x) {
  if (millis()<10000) { return true; } return false;
}

//the first ten seconds have passed
//turn off the LED and remove the rule
void handleAfterTen(int &x) {
  digitalWrite(WLED, LOW);
  Supervisor.removeRule(ledOnFirstTenSeconds);
}

void setup()
{
  Supervisor.addRule(ledOnFirstTenSeconds);

  pinMode(WLED,OUTPUT);
  digitalWrite(WLED, HIGH);
}

void loop()
{
  Supervisor.checkRules();
}
Descripción Remueve una regla del supervisor.
Sintaxis
removeRule(rule)
Parámetros
rule La regla del supervisor para ser removida
Retorna Ninguno
Uso Application
Updated on July 07, 2011 11:16:38pm PDT

Creative Commons License