example/pulse: Implement
diff --git a/example/pulse.cpp b/example/pulse.cpp
index 905869d..452e947 100644
--- a/example/pulse.cpp
+++ b/example/pulse.cpp
@@ -1,4 +1,24 @@
-int main()
+#include <gpioplus/chip.hpp>
+#include <gpioplus/handle.hpp>
+#include <string>
+
+int main(int argc, char* argv[])
{
+ if (argc != 3)
+ {
+ fprintf(stderr, "pulse [chip id] [line offset]\n");
+ return 1;
+ }
+
+ unsigned chip_id = std::stoi(argv[1]);
+ uint32_t line_offset = std::stoi(argv[2]);
+
+ gpioplus::Chip chip(chip_id);
+ gpioplus::HandleFlags flags(chip.getLineInfo(line_offset).flags);
+ flags.output = true;
+ gpioplus::Handle handle(chip, {{line_offset, 0}}, flags, "example/pulse");
+ handle.setValues({1});
+ handle.setValues({0});
+
return 0;
}