lightmeter_scene_help.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "../../lightmeter.h"
  2. void lightmeter_scene_help_on_enter(void* context) {
  3. LightMeterApp* app = context;
  4. FuriString* temp_str;
  5. temp_str = furi_string_alloc();
  6. furi_string_printf(
  7. temp_str,
  8. "App works with BH1750/MAX44009\nambient light sensor\nconnected via I2C interface\n\n");
  9. furi_string_cat(temp_str, "\e#Pinout:\r\n");
  10. furi_string_cat(
  11. temp_str,
  12. " VCC: 3.3V\r\n"
  13. " GND: GND\r\n"
  14. " SDA: 15 [C1]\r\n"
  15. " SCL: 16 [C0]\r\n");
  16. furi_string_cat(temp_str, "\r\n\e#Resolutions:\r\n");
  17. furi_string_cat(
  18. temp_str,
  19. "Low: 4.0lx (16ms, 0-54k)\r\n"
  20. "High: 1.0lx (120ms, 0-54k)\r\n"
  21. "High2: 0.5lx (120ms, 0-27k)\r\n");
  22. widget_add_text_scroll_element(app->widget, 0, 0, 128, 64, furi_string_get_cstr(temp_str));
  23. furi_string_free(temp_str);
  24. view_dispatcher_switch_to_view(app->view_dispatcher, LightMeterAppViewHelp);
  25. }
  26. bool lightmeter_scene_help_on_event(void* context, SceneManagerEvent event) {
  27. UNUSED(context);
  28. UNUSED(event);
  29. return false;
  30. }
  31. void lightmeter_scene_help_on_exit(void* context) {
  32. LightMeterApp* app = context;
  33. widget_reset(app->widget);
  34. }