We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I'm trying to use this library on Jetson Xavier with JetPack 4.6 and ROS-Melodic. It works fine, but...
When I add the function add_event_detection() to my code I always get compilation errors. Even with your example "button_interrupt.cpp".
add_event_detection()
So I made a new small test code:
#include <iostream> #include <string> #include <JetsonGPIO.h> #include <signal.h> bool shutdown = false; void signalHandler(int s) { shutdown = true; } void callback_fn(const std::string& channel) { std::cout << "Callback called from channel " << channel<< std::endl; } int main() { signal(SIGINT, signalHandler); GPIO::setmode(GPIO::BOARD); GPIO::setup(12, GPIO::IN); GPIO::add_event_detect(12, GPIO::RISING, callback_fn); // also tried GPIO::Edge::RISING while(!shutdown) { // } GPIO::remove_event_detect(12); GPIO::cleanup(); return 0; }
When I remove add_event_detection(...) I can compile and run the program without errors. Here is a screenshot of the compilation error message:
add_event_detection(...)
Does anyone know how to fix this?
Greetings Marcel
The text was updated successfully, but these errors were encountered:
From your error:
static_assert(... "Callback return type: void, argument type: int");
The callback argument type changed in the latest version (1.2.0). (old version: int, latest version: const std::string&)
I'm assuming that you installed an old version, and trying the new example code.
Could you re-install the library and try it agian?
Sorry, something went wrong.
Yeah, thank you! That was the problem.
I was using Version v1.0.1, installed it some weeks ago. Now updated to v1.2.0 I can run and compile my code.
No branches or pull requests
Hi,
I'm trying to use this library on Jetson Xavier with JetPack 4.6 and ROS-Melodic. It works fine, but...
When I add the function
add_event_detection()
to my code I always get compilation errors. Even with your example "button_interrupt.cpp".So I made a new small test code:
When I remove
add_event_detection(...)
I can compile and run the program without errors. Here is a screenshot of the compilation error message:Does anyone know how to fix this?
Greetings
Marcel
The text was updated successfully, but these errors were encountered: