Code works on the non online IDE but does not work with the online version

The EdgeDebounceLite.h is not found when I try to use the online version of the IDE I was not able to locate it in the Arduino libraries. It does work with the non online version since I had downloaded the file from the website shown below near the end of his tutorial. I would like to use this on my sketch both online and offline.

/* link =
  https://github.com/j-bellavance/Tutorials/blob/master/State%20machines%20Tutorial/Part%201/TwoStateMachinesDebounced/TwoStateMachinesDebounced.ino

  TwoStateMachinesDebounced.ino
  Author: Jacques Bellavance
  Released: October 13, 2017
  under GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 b

  This code is to demonstrate the use of state machines in an Arduino sketch.
  It is fully explained in the tutorial: State machine with Arduino (Part 1)
*/

#include <EdgeDebounceLite.h>
EdgeDebounceLite debounce;

enum LedStates {ON, OFF};
LedStates ledState = ON;
byte ledPin = 13;

enum SwitchStates {IS_OPEN, IS_RISING, IS_CLOSED, IS_FALLING};
SwitchStates switchState = IS_OPEN;
byte switchPin = 10;

enum SwitchModes {PULLUP, PULLDOWN};
SwitchModes switchMode = PULLUP;

void toggleMachine() {
  switch (ledState) {
    case OFF: {
        digitalWrite(ledPin, HIGH);
        ledState = ON;
        break;
      }
    case ON : {
        digitalWrite(ledPin, LOW);
        ledState = OFF;
        break;
      }
  }
}

void switchMachine() {
  byte pinIs = debounce.pin(switchPin);
  if (switchMode == PULLUP) pinIs = !pinIs;
  switch (switchState) {
    case IS_OPEN: {
        if (pinIs == HIGH) switchState = IS_RISING;
        break;
      }
    case IS_RISING: {
        switchState = IS_CLOSED;
        break;
      }
    case IS_CLOSED: {
        if (pinIs == LOW) switchState = IS_FALLING;
        break;
      }
    case IS_FALLING: {
        toggleMachine();
        switchState = IS_OPEN;
        break;
      }
  }
}

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
  if (switchMode == PULLDOWN) pinMode(switchPin, INPUT);
  else pinMode(switchPin, INPUT_PULLUP);
}

void loop() {
  switchMachine();
}
/* link =
  https://github.com/j-bellavance/Tutorials/blob/master/State%20machines%20Tutorial/Part%201/TwoStateMachinesDebounced/TwoStateMachinesDebounced.ino

  TwoStateMachinesDebounced.ino
  Author: Jacques Bellavance
  Released: October 13, 2017
  under GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 b

  This code is to demonstrate the use of state machines in an Arduino sketch.
  It is fully explained in the tutorial: State machine with Arduino (Part 1)
*/

#include <EdgeDebounceLite.h>
EdgeDebounceLite debounce;

enum LedStates {ON, OFF};
LedStates ledState = ON;
byte ledPin = 13;

enum SwitchStates {IS_OPEN, IS_RISING, IS_CLOSED, IS_FALLING};
SwitchStates switchState = IS_OPEN;
byte switchPin = 10;

enum SwitchModes {PULLUP, PULLDOWN};
SwitchModes switchMode = PULLUP;

void toggleMachine() {
  switch (ledState) {
    case OFF: {
        digitalWrite(ledPin, HIGH);
        ledState = ON;
        break;
      }
    case ON : {
        digitalWrite(ledPin, LOW);
        ledState = OFF;
        break;
      }
  }
}

void switchMachine() {
  byte pinIs = debounce.pin(switchPin);
  if (switchMode == PULLUP) pinIs = !pinIs;
  switch (switchState) {
    case IS_OPEN: {
        if (pinIs == HIGH) switchState = IS_RISING;
        break;
      }
    case IS_RISING: {
        switchState = IS_CLOSED;
        break;
      }
    case IS_CLOSED: {
        if (pinIs == LOW) switchState = IS_FALLING;
        break;
      }
    case IS_FALLING: {
        toggleMachine();
        switchState = IS_OPEN;
        break;
      }
  }
}

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
  if (switchMode == PULLDOWN) pinMode(switchPin, INPUT);
  else pinMode(switchPin, INPUT_PULLUP);
}

void loop() {
  switchMachine();
}

State machine with Arduino Part 1.pdf (813 KB)

State machine with Arduino Part 1a.pdf (797 KB)

All the libraries in the Arduino Library Manager index are pre-installed in the Arduino Web Editor. To use any library not in the Library Manager index, you need to import it. If you tried to do that with the EdgeDebounceLite library already, you may have encountered this error:

[] library.properties not found

The reason is that, unlike the Arduino IDE, the Arduino Web Editor requires that even libraries in the 1.0 Arduino library format have a library.properties file, but this library does not have one.

The solution is to add that file:

Download the library: https://github.com/j-bellavance/EdgeDebounceLite/archive/master.zip

Unzip the downloaded file.

Delete the downloaded .zip file.

In the unzipped folder, at the same place where EdgeDebounceLite.h is found, create a file named library.properties.

Open library.properties in a text editor.

Paste the following text into the editor:

name=EdgeDebounceLite
version=0.1.0-beta
author=Jacques bellavance
maintainer=Jacques bellavance
sentence=Debounce any/all pins of any/all arduinos, with just one instance.
paragraph=
category=Signal Input/Output
url=https://github.com/j-bellavance/EdgeDebounceLite
architectures=*
includes=EdgeDebounceLite.h

Save the file.

Zip the folder.

(In the Arduino Web Editor) Click the upward pointing arrow button (Import).

If you get a message about importing your sketchbook, click the "Import" button.

Select the .zip file you created.

Click the "Open" button.

Wait until you get a confirmation that the library was successfully imported.

After that, the code should compile in the Arduino Web Editor. The only other problem you may have is that I notice you pasted the sketch twice in your forum post. If you do the same in the Arduino Web Editor, you will get a bunch of "redefinition" errors.

Thank you Pert,

My mouse button is getting kind of flaky and has often pasted more then one time. I wonder if the origination of the file (Jacques Bellavance) should do that procedure rather than me. I will try to contact him.

Thanks again
Rick

I agree that it's best for the issue to be fixed in Jacques Bellavance's repository so that nobody else will have the same problem. There are thousands of Arduino libraries with the same issue. This is a recent development so I think most of the library authors are unaware of this new requirement.

Thanks again Pert,

I signed up on GitHub and entered a message to Jacques Bellavance, requesting what you have provided above.

Have a good day and given more time I will be doing your other suggestions as you provided in my other forum request.