air_sensor: Move common reading code to function

I erased 2 that were the same. And I copied it in another place called
a function. I used the function to read the sensor.

- Tali

Change-Id: I4e4a97b03891e2455839ca302040b3dc3f504a10
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/229291
Reviewed-by: Taylor Cramer <cramertj@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Yuval Peress <peress@google.com>
2 files changed
tree: 223a25c8cfe7d7233b3c8531e540eb619c5024b9
  1. .github/
  2. .vscode/
  3. apps/
  4. device/
  5. modules/
  6. system/
  7. targets/
  8. tools/
  9. web_app/
  10. .bazelignore
  11. .bazelrc
  12. .bazelversion
  13. .buildifier.json
  14. .clang-format
  15. .clangd.shared
  16. .gitignore
  17. .pw_console.yaml
  18. AUTHORS
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. OWNERS
  24. pigweed.json
  25. README.md
README.md

Sense

git clone https://pigweed.googlesource.com/pigweed/showcase/sense

Welcome to Pigweed Sense, a tour of key Pigweed components experienced through an imagined air quality product.

Please visit Sense: An interactive tour through Pigweed to get started.