Files
twang-mp/TWANG32/Lava.h
per1234 840eab60aa Move sketch to appropriately named subfolder
The Arduino IDE requires that a sketch be located in a folder of the same name. Although the name of the repository does match the sketch name, when GitHub's popular Clone or download > Download ZIP feature is used to download the contents of a repository the branch/release/commit name is appended to the folder name, causing a mismatch.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "TWANG32.ino" needs to be inside a sketch folder named "TWANG32".
Create this folder, move the file, and continue?

After clicking "OK" the Arduino IDE currently moves only the file TWANG32.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

TWANG32-master\TWANG32\TWANG32.ino:30:23: fatal error: twang_mpu.h: No such file or directory
2018-04-28 22:40:54 -07:00

40 lines
712 B
C++

#include "Arduino.h"
class Lava
{
public:
void Spawn(int left, int right, int ontime, int offtime, int offset, int state);
void Kill();
int Alive();
int _left;
int _right;
int _ontime;
int _offtime;
int _offset;
long _lastOn;
int _state;
static const int OFF = 0;
static const int ON = 1;
private:
int _alive;
};
void Lava::Spawn(int left, int right, int ontime, int offtime, int offset, int state){
_left = left;
_right = right;
_ontime = ontime;
_offtime = offtime;
_offset = offset;
_alive = 1;
_lastOn = millis()-offset;
_state = state;
}
void Lava::Kill(){
_alive = 0;
}
int Lava::Alive(){
return _alive;
}