Marco Zonca
Published © GPL3+

Acoustic Vario (ultra sensitive barometer) solar powered

As a paragliding pilot I have built my own instrument that plays bip-bip during climb, and plays beep when sink down: with battery + solar!

AdvancedFull instructions provided267
Acoustic Vario (ultra sensitive barometer) solar powered

Things used in this project

Hardware components

Arduino Pro Mini 328 - 3.3V/8MHz
SparkFun Arduino Pro Mini 328 - 3.3V/8MHz
×1
Barometric Sensor BMP 280
×1
SparkFun FTDI Basic Breakout - 3.3V
SparkFun FTDI Basic Breakout - 3.3V
×1

Software apps and online services

Arduino IDE
Arduino IDE
PCBWay online Services for PCB and 3D Printing (optional)

Story

Read more

Custom parts and enclosures

3D printing Enclosure box

Sketchfab still processing.

3D printing Enclosure cover

Sketchfab still processing.

PCB Gerber file

Schematics

Arduino Pro Mini 3.3V pinout

PCB top layer

PCB bottom layer

PCB top SILK layer

PCB bottom SILK layer

Schematic diagram

Code

Arduino code (sketch) of Vario2C

Arduino
//
// Vario2c by Marco Zonca 10/2024, version 1.00
// 
//
// variometer with BMP280 barometric sensor board, Arduino MiniPro 3.3v MCU, blue LED diod,
// passive buzzer with SN7400 NAND port (used as NOT) and two high pass filters to double
// the sound signal, shottky diod, 5V solar panel, LIR1654 3.6V 120mAh LiPo battery,
// MCP73831 charger chip, mini USB, Infrared receiver VS1838b, IR remote control, internal EEPROM,
// a few other SMD components;
//
// For programming the Arduino Pro Mini it needs to use a FTDI232 board and the Arduino IDE;
//
// Barometric sensor is light susceptible, so to have stable/accurate readings and avoid unwanted/unexpected bips
// do not use the circuit in transparent enclosure and avoid direct strong light; I suggest to put a black hat 
// over it internally (foam or neoprene);
//
// install IRremote.h library version 2.6.1 (internally is written 2.0.1); before compiling adjust flags in IRemote.h (lines 43...98)
// according to your remote control: for the one I used here (see picture) I set line 49 as "#define DECODE_NEC 1"
// setting the others to 0 value (not line 99, leave it at 1). Avoid to use remote control under direct sun light;
// with other remote control you have to adj button IR codes in function readIRRemote() too;
//
// NewTone Library - v1.0 01/20/2013, IRremote - Version 2.0.1 June 2015, Adafruit BMP280 Library 2.6.8 files 30.05.2023 20:00
//

/*

Buttons codes of IR remote control:
----------------------------------
 1 = 0xFFA25D
 2 = 0xFF629D
 3 = 0xFFE21D
 4 = 0xFF22DD
 5 = 0xFF02FD
 6 = 0xFFC23D
 7 = 0xFFE01F
 8 = 0xFFA857
 9 = 0xFF906F
 0 = 0xFF9867
 * = 0xFF6897
 # = 0xFFB04F
 up    = 0xFF18E7
 down  = 0xFF4AB5
 left  = 0xFF10EF
 right = 0xFF5AA5
 ok    = 0xFF38C7

I/R receiver codes programming:
-------------------------------------------------------------------------------------------------------------------------------
Up          5   10    20    50   100                OK   (lift minimum rate, cm/sec, 10=0.1m/sec) -> minlift (5-199)
UpUp        1   10    50    100  200    250         OK   (increment of frequency bip during lift, Hz per m/sec) -> incremUU (1-250)
Down        5   50   100   200   500    999         OK   (sink rate alarm, cm/sec, 200=-2m/sec) -> sinkrate (5-999)
#        1000     2900                              OK   (lift sound base frequency, Hz, going up) -> LiftHz (600-4000)
*         160      320                              OK   (sink sound base frequency, Hz going down)   -> SinkHz (160-600)
right       1    5    20    25    30     50         OK   (bip frequency added to lift rate, i.e. 15=1.5Hz) -> bipFreqAdd (1-50)
left       10   20    25    50    80    100         OK   (% dutycycle of silence after beep, 25=25%)  -> dutycycle (10-100)
leftleft  100  150   200   250   400    500         OK   (sample interval in millisec, 250, submultiple of 1000) -> SampleInterval (50-500)

Basic standard setup IR buttons sequences: Up 20 ok, Down 200 ok, # 2900 ok, * 300 ok, right 40 ok, left 25 ok, UpUp 200 ok, leftleft 250 ok

NOTES: by the way of the remote control you could choose any values but take in account, for the bips,
=====  the buzzer "best & loud" sound is around 1000Hz and 2900Hz due to its construction characteristics;
       the sound level should be fine, but if it is too high for you, you could change the frequency and have better
       feeling (i.e. around 800Hz);

*/

#include <EEPROM.h>
#include <IRremote.h>
#include <NewTone.h>
#include  <Adafruit_BMP280.h>

const boolean isDebug = false;  // set to "true" to have serial monitor debug and live data output 

const byte buzzerPin=14;
const byte vBatPin=15;
const byte IRReceivePin=16;

const int freq=3400;
const int freqOk=1000;
const int freqBad=100;
const int longMSec=200;
const int longMSecOk=400;
const int longMSecBad=800;

//----------------------------------------------
const int memID=12345;
const long ServiceInterval = (30.0 * 1000.0);  // every 30sec check battery
const double vbattWarning = 3.40;  // warning should be more than 3.3v regulator
const long BaselineInterval = (15.0 * 60.0 * 1000.0);  // every 15min update baseline

unsigned int SinkHz = 300;  // sink standard tone frequency, beeep
unsigned int LiftHz = 2900;  // lift standard tone frequency, bip
double minlift = (+0.2);  // standard lift rate for bip, m/sec
double sinkrate = (-2.0);  // standard sink rate for beeep, m/sec
double bipFreqAdd = 4.0; // freq=1/(Vario+bipFreqAdd), higher=more bipbip speed
int dutycycle = 25;  // 25% dutycycle of silence after beep
int incremUU = 200;  // increment of frequency during bip lift, Hz every 1m/sec
long SampleInterval = 250;  // milliSec, submultiple of 1000
//----------------------------------------------

double Pressure = 0;
double Altitude = 0;
unsigned long prevMillis = 0;
unsigned long prevMillisService = 0;
unsigned long prevMillisBaseline = 0;
unsigned long prevMillisBeep = 0;
double AltiAttuale = 0;
double AltiPrev = 0;
double Vario = 0;
double baseline = 0;
double TotAlt=0;
double TotNr=0;
double v = 0;
int n1 = 0;
double n2 = 0;
int timeToBeep = 0;
int timeToSilent = 0;
int result = 0;
int increm=0;
unsigned long errors=0;
long IRrxdata=0;
unsigned long duration = 0;
boolean isFirstCalc=true;

int eeaddress=0;
int eedata_ID=0;
int eedata_SinkHz=0;
int eedata_LiftHz=0;
float eedata_minlift=0;
float eedata_sinkrate=0;
float eedata_bipfreqadd=0;
int eedata_dutycycle=0;
int eedata_incremUU=0;
int eedata_SampleInterval=0;

String IR_parameter;
String IR_tmp;
unsigned int IR_nrx=0;

IRrecv irrecv(IRReceivePin);
decode_results results;
Adafruit_BMP280 bmp;

void setup() {
  IR_parameter.reserve(11);
  IR_tmp.reserve(5);
  pinMode(vBatPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
  if (isDebug == true) {Serial.begin (115200);}
  if (isDebug == true) {Serial.println(F("*serial ok*"));}
  bmp.begin(0x76);
  bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,     /* Operating Mode: SLEEP FORCED NORMAL SOFT_RESET_CODE */
                  Adafruit_BMP280::SAMPLING_X2,     /* Temperature oversampling: NONE X1 X2 X4 X8 X16 */
                  Adafruit_BMP280::SAMPLING_X16,    /* Pressure oversampling: NONE X1 X2 X4 X8 X16 */
                  Adafruit_BMP280::FILTER_X16,      /* Filtering: OFF X2 X4 X8 X16 */
                  Adafruit_BMP280::STANDBY_MS_1);  /* Standby time: 1 63 125 250 500 1000 2000 4000 */
  if (isDebug == true) {Serial.println(F("*BMP280 ok*"));}
  irrecv.enableIRIn();
  irrecv.blink13(false);  // internal led when IR receiving (false=disabled)
  if (isDebug == true) {Serial.println(F("*IR ok*"));}
  baseline = bmp.readPressure()/100;  // used as altitude reference, updated from time to time
  prevMillisBaseline=millis();
  if (isDebug == true) {Serial.print(F("baseline mb="));}
  if (isDebug == true) {Serial.println(baseline,2);}
  readEEPROMparams();
  duration = 1000;
  NewTone (buzzerPin,LiftHz,duration);
  delay(1000);
}//setup()

void loop() {
  if (prevMillisService == 0) {prevMillisService=millis();}
  if (millis() > (prevMillisService + ServiceInterval)) {checkVIn();}

  if (prevMillis == 0) {prevMillis=millis();}
  if (millis() < (prevMillis + SampleInterval)) {
    Pressure = bmp.readPressure()/100;
    if (Pressure <= 356.00 || Pressure >= 1140.00) {  // ignore higher than 8000m, lower than -1000m
      Altitude = -9999;
      errors++;
     }else{
      Altitude = (44330.0 * (1.0 - pow(Pressure / baseline, 0.190294957183635)));  // convert Pressure to Altitude
      TotAlt=TotAlt+Altitude;
      TotNr++;
    }
  } else {
    AltiAttuale=(TotAlt/TotNr);
    if (isFirstCalc==true) {
      AltiPrev=AltiAttuale;
      isFirstCalc=false;
    }
    Vario=(AltiAttuale-AltiPrev)*(1000/SampleInterval);  // Vario value to m/sec
    if (millis() > (prevMillisBeep + (timeToBeep+timeToSilent))) {
      goBeep();
    }
  }
  readIRRemote();
}//loop()


void goBeep() {
    if (Vario > minlift) {  //                         *** lift bip bip ++
      timeToBeep=(1/(Vario+bipFreqAdd))*1000;  //          millisec, T=1/f
      timeToSilent=(timeToBeep*dutycycle/100);  //         millis, pause after bip
      increm=int(Vario*incremUU);  //                      (increm (+)) increase frequency to lift rate
      NewTone (buzzerPin,(LiftHz+increm),timeToBeep);
    }
    if ((Vario < sinkrate)) {  //                      *** sink beeeeeep --
      timeToBeep=600;
      timeToSilent=(timeToBeep*dutycycle/100);  //         millis, pause after beeeeeep
      increm=0;  //                                       (increm (-)) decrease frequency proportionally to sink rate
      NewTone (buzzerPin,(SinkHz+increm),timeToBeep);  
    }
    if ((Vario <= minlift) && (Vario >= sinkrate)) {// *** silent ==
      timeToBeep=0;
      timeToSilent=0;
      if (millis() > (prevMillisBaseline + BaselineInterval)) {
        baseline = bmp.readPressure()/100;  // used as altitude reference, updated from time to time
        isFirstCalc=true;
        if (isDebug == true) {
          Serial.print(F("New baseline="));
          Serial.println(baseline,2);
        }
        prevMillisBaseline=millis();
      }
    }
    if (isDebug == true) {
      Serial.print(F("vario="));
      Serial.print(Vario,2);
      Serial.print(F(" alt="));
      Serial.print(Altitude,2);
      Serial.print(F(" reads="));
      Serial.print(TotNr,0);
      Serial.print(F(" err="));
      Serial.println(errors);    
    }
    TotAlt=0;
    TotNr=0;
    prevMillis=0;
    AltiPrev=AltiAttuale;
    prevMillisBeep=millis();
}//goBeep()


void readEEPROMparams() {
  eeaddress=1;
  EEPROM.get(eeaddress,eedata_ID);
  eeaddress=51;
  EEPROM.get(eeaddress,eedata_dutycycle);
  if (eedata_dutycycle==0) {eedata_dutycycle=25;}
  eeaddress=101;
  EEPROM.get(eeaddress,eedata_SinkHz);
  if (eedata_SinkHz==0) {eedata_SinkHz=300;}
  eeaddress=151;
  EEPROM.get(eeaddress,eedata_incremUU);
  if (eedata_incremUU==0){eedata_incremUU=200;}
  eeaddress=201;
  EEPROM.get(eeaddress,eedata_LiftHz);
  if (eedata_LiftHz==0){eedata_LiftHz=2900;}
  eeaddress=251;
  EEPROM.get(eeaddress,eedata_SampleInterval);
  if (eedata_SampleInterval==0){eedata_SampleInterval=250;}
  eeaddress=301;
  EEPROM.get(eeaddress,eedata_minlift);
  if (eedata_minlift==0){eedata_minlift=(+0.2);}
  eeaddress=401;
  EEPROM.get(eeaddress,eedata_sinkrate);
  if (eedata_sinkrate==0){eedata_sinkrate=(-2.0);}
  eeaddress=501;
  EEPROM.get(eeaddress,eedata_bipfreqadd);
  if (eedata_bipfreqadd==0){eedata_bipfreqadd=4.0;}
  if (eedata_ID != memID) {
    if (isDebug == true) { Serial.println(F("* EEPROM first read -> initialize with default values *")); };
    updateEEPROM();
  }
  dutycycle=eedata_dutycycle;
  SinkHz=eedata_SinkHz;
  incremUU=eedata_incremUU;
  LiftHz=eedata_LiftHz;
  SampleInterval=eedata_SampleInterval;
  minlift=eedata_minlift;
  sinkrate=eedata_sinkrate;
  bipFreqAdd=eedata_bipfreqadd;
  if (isDebug == true) {
    Serial.print(F("dutycycle%="));
    Serial.print(dutycycle);
    Serial.print(F(" SinkHz="));
    Serial.print(SinkHz);
    Serial.print(F(" incremUU="));
    Serial.print(incremUU);
    Serial.print(F(" LiftHz="));
    Serial.print(LiftHz);
    Serial.print(F(" SampleInterval="));
    Serial.print(SampleInterval);
    Serial.print(F(" minlift="));
    Serial.print(minlift);
    Serial.print(F(" sinkrate="));
    Serial.print(sinkrate);
    Serial.print(F(" bipfreqadd="));
    Serial.println(bipFreqAdd);
  }
}//readMemoryParams()

void updateEEPROM() {
  bool isDataChanged=false;
  if (eedata_ID != memID) {
    eedata_ID=memID;
    eeaddress=1;
    EEPROM.put(eeaddress,eedata_ID);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_dutycycle != dutycycle) {
    eedata_dutycycle=dutycycle;
    eeaddress=51;
    EEPROM.put(eeaddress,eedata_dutycycle);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_SinkHz != SinkHz) {
    eedata_SinkHz=SinkHz;
    eeaddress=101;
    EEPROM.put(eeaddress,eedata_SinkHz);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_incremUU != incremUU) {
    eedata_incremUU=incremUU;
    eeaddress=151;
    EEPROM.put(eeaddress,eedata_incremUU);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_LiftHz != LiftHz) {
    eedata_LiftHz=LiftHz;
    eeaddress=201;
    EEPROM.put(eeaddress,eedata_LiftHz);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_SampleInterval != SampleInterval) {
    eedata_SampleInterval=SampleInterval;
    eeaddress=251;
    EEPROM.put(eeaddress,eedata_SampleInterval);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_minlift != minlift) {
    eedata_minlift=minlift;
    eeaddress=301;
    EEPROM.put(eeaddress,eedata_minlift);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_sinkrate != sinkrate) {
    eedata_sinkrate=sinkrate;
    eeaddress=401;
    EEPROM.put(eeaddress,eedata_sinkrate);
    delay(10);
    isDataChanged=true;
  }
  if (eedata_bipfreqadd != bipFreqAdd) {
    eedata_bipfreqadd=bipFreqAdd;
    eeaddress=501;
    EEPROM.put(eeaddress,eedata_bipfreqadd);
    delay(10);
    isDataChanged=true;
  }
  //if (isDataChanged==true) {EEPROM.commit();}  // not necessary for MiniPro MCU
  if (isDebug && isDataChanged==true) {Serial.println(F("* EEPROM updated *"));}
}//updateEEPROM()

void checkVIn() {
  duration = 45;
  n1 = analogRead(vBatPin);
  n2=(((6.60 * n1) / 1023.00));
  v=(n2 + ((n2 * 0.0) /100));  // arbitrary correction (not active if 0.0%)
  if (v < vbattWarning) {
    NewTone (buzzerPin,1000,duration);
    delay(50);
    NewTone (buzzerPin,2900,duration);
    delay(50);
    NewTone (buzzerPin,1000,duration);
    delay(50);
    NewTone (buzzerPin,2900,duration);
    delay(50);
    NewTone (buzzerPin,1000,duration);
    delay(50);
    NewTone (buzzerPin,2900,duration);
    delay(100);
  }
  if (isDebug == true) {
    Serial.print(F("Vin="));
    Serial.print(v,2);
    Serial.print(F(" analogRead="));
    Serial.println(n1);
  }
  prevMillisService=millis();
}//checkVIn()

void readIRRemote() {
  bool toeval=false;
  bool validCommand=false;
  if (irrecv.decode(&results)){
    IRrxdata=results.value;
    //Serial.println(IRrxdata, HEX);
    switch (IRrxdata) {
      case 0xFF18E7:
        if (isDebug == true) { Serial.println("up"); };
        NewTone (buzzerPin,freq,longMSec);
        if (IR_parameter=="U") {
          IR_parameter="UU";
         }else{
          IR_parameter="U";
        }
      break;
      case 0xFF4AB5:
        if (isDebug == true) { Serial.println("down"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter="D";
      break;
      case 0xFF10EF:
        if (isDebug == true) { Serial.println("left"); };
        NewTone (buzzerPin,freq,longMSec);
        if (IR_parameter=="L") {
          IR_parameter="LL";
         }else{
          IR_parameter="L";
        }
      break;
      case 0xFF5AA5:
        if (isDebug == true) { Serial.println("right"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter="R";
      break;
      case 0xFF38C7:
        if (isDebug == true) { Serial.println("ok"); };
        NewTone (buzzerPin,freq,longMSec);
        toeval=true;
      break;
      case 0xFFA25D:
        if (isDebug == true) { Serial.println("1"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "1";
      break;
      case 0xFF629D:
        if (isDebug == true) { Serial.println("2"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "2";
      break;
      case 0xFFE21D:
        if (isDebug == true) { Serial.println("3"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "3";
      break;
      case 0xFF22DD:
        if (isDebug == true) { Serial.println("4"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "4";
      break;
      case 0xFF02FD:
        if (isDebug == true) { Serial.println("5"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "5";
      break;
      case 0xFFC23D:
        if (isDebug == true) { Serial.println("6"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "6";
      break;
      case 0xFFE01F:
        if (isDebug == true) { Serial.println("7"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "7";
      break;
      case 0xFFA857:
        if (isDebug == true) { Serial.println("8"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "8";
      break;
      case 0xFF906F:
        if (isDebug == true) { Serial.println("9"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "9";
      break;
      case 0xFF9867:
        if (isDebug == true) { Serial.println("0"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter += "0";
      break;
      case 0xFF6897:
        if (isDebug == true) { Serial.println("*"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter="*";
      break;
      case 0xFFB04F:
        if (isDebug == true) { Serial.println("#"); };
        NewTone (buzzerPin,freq,longMSec);
        IR_parameter="#";
      break;
    }
    irrecv.resume();
  }
  if (IR_parameter.length() > 5) {
    NewTone (buzzerPin,freqBad,longMSecBad);
    if (isDebug == true) { Serial.print(F("Too long command: ")); };
    if (isDebug == true) { Serial.println(IR_parameter); };
    IR_parameter="";
  }
  if (toeval==true && IR_parameter.length() < 2) {
    NewTone (buzzerPin,freqBad,longMSecBad);
    if (isDebug == true) { Serial.print(F("Too short command: ")); };
    if (isDebug == true) { Serial.println(IR_parameter); };
    IR_parameter="";
    toeval=false;
  }

  if (toeval==true) {  // evaluate entered IR command
    if ((IR_parameter.substring(0,1) == "L") && (IR_parameter.substring(0,2) != "LL")) {  // left, dutycycle
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 10 && IR_nrx <= 100){
        dutycycle=int(IR_nrx);
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,2) == "LL") {  // leftleft, SampleInterval
      IR_tmp=IR_parameter.substring(2,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 50 && IR_nrx <= 500){
        SampleInterval=int(IR_nrx);
        validCommand=true;
      }
    }
    if ((IR_parameter.substring(0,1) == "U") && (IR_parameter.substring(0,2) != "UU")) {  // up, minimum lift rate to bip
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (isDebug == true) {
        Serial.print(F("tmp: ")); 
        Serial.print(IR_tmp);
        Serial.print(F(" nrx=")); 
        Serial.println(IR_nrx);
       }
      if (IR_nrx >= 5 && IR_nrx <= 100){
        minlift=(float(IR_nrx)/100);
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,2) == "UU") {  // upup, increment of beep frequency during lift
      IR_tmp=IR_parameter.substring(2,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (isDebug == true) {
        Serial.print(F("tmp: ")); 
        Serial.print(IR_tmp);
        Serial.print(F(" nrx=")); 
        Serial.println(IR_nrx);
       }
      if (IR_nrx >= 1 && IR_nrx <= 250){
        incremUU=int(IR_nrx);
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,1) == "R") {  // right, bipFreqAdd
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 1 && IR_nrx <= 50){
        bipFreqAdd=(float(IR_nrx)/10);
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,1) == "D") {  // down, sink rate to beeeep
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 5 && IR_nrx <= 999){
        sinkrate=(float(IR_nrx)/100) * (-1);
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,1) == "*") {  // sink sound frequency
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 160 && IR_nrx <= 600){
        SinkHz=IR_nrx;
        validCommand=true;
      }
    }
    if (IR_parameter.substring(0,1) == "#") {  // lift sound frequency
      IR_tmp=IR_parameter.substring(1,IR_parameter.length());
      IR_nrx=IR_tmp.toInt();
      if (IR_nrx >= 600 && IR_nrx <= 4000){
        LiftHz=IR_nrx;
        validCommand=true;
      }
    }
    if (validCommand==true) {
      if (isDebug == true) { Serial.print(F("Valid command: ")); };
      if (isDebug == true) { Serial.println(IR_parameter); };
      updateEEPROM();
      NewTone (buzzerPin,freqOk,100);
      delay(200);
      NewTone (buzzerPin,freqOk,longMSecOk);
      IR_parameter="";
     }else{  
      NewTone (buzzerPin,freqBad,longMSecBad);
      if (isDebug == true) { Serial.print(F("Bad command: ")); };
      if (isDebug == true) { Serial.println(IR_parameter); };
      IR_parameter="";
    }
  }//if (toeval==true)

}//readIRRemote

Credits

Marco Zonca
17 projects • 50 followers
"From an early age I learned to not use pointers"
Contact

Comments

Please log in or sign up to comment.