Skip to content

Commit

Permalink
added debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
VincidaB committed May 8, 2024
1 parent a222335 commit c731273
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Empty file.
Empty file.
10 changes: 6 additions & 4 deletions src/ezbot_command_module/src/tirette_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,24 @@ void TiretteNode::readGPIO()
int value;

chip = gpiod_chip_open("/dev/gpiochip0");
printf("chip : %p\n", chip);

if (!chip) {
// handle error
printf("unable to open GPIO\n")
}

line = gpiod_chip_get_line(chip, 11);
if (!line) {
// handle error
printf("unable to get line\n")
}

if (gpiod_line_request_input(line, "tirette_node") < 0) {
// handle error
printf("unable to request line\n")
}

value = gpiod_line_get_value(line);
if (value < 0) {
// handle error
printf("unable to get value\n")
}

message.data = value ? true : false;
Expand Down

0 comments on commit c731273

Please sign in to comment.