lightmeter_scene_help.c 984 B

12345678910111213141516171819202122232425262728293031323334
  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, "App works with BH1750\nambient light sensor\nconnected via I2C interface\n\n");
  8. furi_string_cat(temp_str, "\e#Pinout:\r\n");
  9. furi_string_cat(
  10. temp_str,
  11. " VCC: 3.3V\r\n"
  12. " GND: GND\r\n"
  13. " SDA: 15 [C1]\r\n"
  14. " SCL: 16 [C0]\r\n");
  15. widget_add_text_scroll_element(app->widget, 0, 0, 128, 64, furi_string_get_cstr(temp_str));
  16. furi_string_free(temp_str);
  17. view_dispatcher_switch_to_view(app->view_dispatcher, LightMeterAppViewHelp);
  18. }
  19. bool lightmeter_scene_help_on_event(void* context, SceneManagerEvent event) {
  20. UNUSED(context);
  21. UNUSED(event);
  22. return false;
  23. }
  24. void lightmeter_scene_help_on_exit(void* context) {
  25. LightMeterApp* app = context;
  26. widget_reset(app->widget);
  27. }