Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // Name : gpio_test.cpp
- // Author : James Howard
- // Version :
- // Copyright :
- // Description : Hello World in C++, Ansi-style
- //============================================================================
- #include <iostream>
- #include <stdio.h>
- #include <unistd.h>
- #include "lib/gpio/GPIOManager.h"
- #include "lib/gpio/GPIOConst.h"
- using namespace std;
- int main() {
- GPIO::GPIOManager* gp = GPIO::GPIOManager::getInstance();
- int pin = GPIO::GPIOConst::getInstance()->getGpioByKey("USR3");
- cout << "USR3 LED Flash GPIO Test" << endl;
- while(1) {
- gp->setValue(pin, GPIO::HIGH);
- cout << "LED On" << endl;
- sleep(1);
- gp->setValue(pin, GPIO::LOW);
- cout << "LED Off" << endl;
- sleep(1);
- }
- gp->~GPIOManager();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement