forked from JanuszBedkowski/mandeye_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathled_demo.cpp
More file actions
52 lines (41 loc) · 1.96 KB
/
led_demo.cpp
File metadata and controls
52 lines (41 loc) · 1.96 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
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <gpios.h>
#include <thread>
#include <chrono>
#include "hardware_config/mandeye.h"
int main(int arc, char *argv[]){
using namespace hardware;
std::cout << "led_demo" << std::endl;
std::cout << mandeyeHarwareType << std::endl;
std::shared_ptr<mandeye::GpioClient> gpioClientPtr;
gpioClientPtr = std::make_shared<mandeye::GpioClient>(false);
for(int i = 0; i < 1000; i++)
{
std::cout << "iteration " << i + 1 << " of 10" << std::endl;
std::cout << "LED_GPIO_STOP_SCAN ON" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_STOP_SCAN, true);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "LED_GPIO_COPY_DATA ON" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_COPY_DATA, true);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "LED_GPIO_CONTINOUS_SCANNING ON" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_CONTINOUS_SCANNING, true);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "BUZZER ON" << std::endl;
gpioClientPtr->setLed(LED::BUZZER, true);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "BUZZER OFF" << std::endl;
gpioClientPtr->setLed(LED::BUZZER, false);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "LED_GPIO_STOP_SCAN OFF" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_STOP_SCAN, false);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "LED_GPIO_COPY_DATA OFF" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_COPY_DATA, false);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "LED_GPIO_CONTINOUS_SCANNING OFF" << std::endl;
gpioClientPtr->setLed(LED::LED_GPIO_CONTINOUS_SCANNING, false);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
return 0;
}