-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproperty.cpp
More file actions
40 lines (33 loc) · 1.29 KB
/
property.cpp
File metadata and controls
40 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**************************************************************************\
* Apio Library *
* https://github.com/Apio/library-Apio *
* Copyright (c) 2012-2014, Apio Inc. All rights reserved. *
* ------------------------------------------------------------------------ *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the BSD License as described in license.txt. *
\**************************************************************************/
#include <Arduino.h>
#include "property.h"
#include <avr/eeprom.h>
#include "atmegarfr2.h"
#include "StringBuffer.h"
#include "String.h"
ApioProperty property;
ApioProperty::ApioProperty() {
}
ApioProperty::~ApioProperty() { }
void ApioProperty::Trigger(char *propertyName, int pin, int onValue, int offValue){
//Serial.println(Apio.property+" "+propertyName);
if(Apio.property == propertyName){
if(onValue == Apio.value.toInt()){
digitalWrite(pin, onValue);
} else if (offValue == Apio.value.toInt()){
digitalWrite(pin, offValue);
}
}
}
void ApioProperty::Slider(String propertyName, int pin){
if(Apio.property == propertyName){
analogWrite(pin, Apio.value.toInt());
}
}