summaryrefslogtreecommitdiffstats
path: root/led.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'led.cpp')
-rw-r--r--led.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/led.cpp b/led.cpp
index 1d10e24..4888d84 100644
--- a/led.cpp
+++ b/led.cpp
@@ -9,7 +9,7 @@
led::led(gpio *pin, led::color color) : _pin(pin), _color(color)
{
- _pin->set_mode(0);
+ _pin->set_mode(0); // output
}
@@ -45,9 +45,9 @@ void led::set(unsigned s)
_pin->set(s);
}
-unsigned led::read() const
+unsigned led::is_set() const
{
- return _pin->read();
+ return _pin->is_set();
}
void led::toggle()
@@ -74,7 +74,7 @@ std::string led::to_string()
}
str += ") is ";
- str += (read()) ? "on" : "off";
+ str += (is_set()) ? "on" : "off";
return str;
}