наследование

This commit is contained in:
Dmitry Borisenko
2020-07-30 11:27:12 +02:00
parent 7806aa1ae8
commit 854d5f42e5
3 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include "Class/Button.h"
#include "Global.h" #include "Global.h"
class Item { class Item {

View File

@@ -7,7 +7,7 @@
class Button : public Item { class Button : public Item {
public: public:
Button() : Item() {} Button() : Item()
void pinModeSet(int pinf) { void pinModeSet(int pinf) {
if (pin != "") { if (pin != "") {
@@ -32,4 +32,4 @@ class Button : public Item {
} }
}; };
extern Button* myButton; //extern Button* myButton;

View File

@@ -118,7 +118,7 @@ void button() {
sCmd.addCommand(key.c_str(), buttonSet); sCmd.addCommand(key.c_str(), buttonSet);
myItem->pinModeSet(pin.toInt); myItem->pinModeSet(pin.toInt());
if (pin != "") { if (pin != "") {
pinMode(pin.toInt(), OUTPUT); pinMode(pin.toInt(), OUTPUT);