nmaggioni commented on PR #16838: URL: https://github.com/apache/nuttx/pull/16838#issuecomment-3187866546
@acassis What do you mean by board profile example? Sorry, I didn't find an example browsing similar past PRs. Reading meaningful values from the sensor is already handled internally, so it's just a matter of executing a `read()` more or less like this: <details> <summary>Example code</summary> ```c int main(int argc, FAR char * argv[]) { UNUSED(argc); UNUSED(argv); const char *devpath = "/dev/temp0"; int fd = open(devpath, O_RDONLY); if (fd < 0) { printf("Failed to open %s: %s (%d)\n", devpath, strerror(errno), errno); return EXIT_FAILURE; } float sample; int ret = read(fd, & sample, sizeof(uint16_t)); if (ret != sizeof(sample)) { perror("Could not read fd"); return EXIT_FAILURE; } printf("%s = %.03f\n", devpath, sample); close(fd); return EXIT_SUCCESS; } ``` </details> ~~Is this worthy of its own app?~~ Why not, an example is always useful after all. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org