unleashed-firmware/applications/examples/example_thermo
Sean Skyhawk 41fcead710
Images linting: ensure that all images conform specification (#3802)
* Change all icons to be white background
* assets: re-processed all *.png images to 1-bit
* assets: also stripped profile data from .pngs
* assets: also stripped datetime from metadata (`-define png:exclude-chunks=date,time`)
* scripts: added image linter and formatter; fbt: added `lint_img` && `format_img` targets; github: integrated image lint step into CI
* scripts: imglint: fixed deprecation warning
* images: applied `format_img`
* fbt: added `lint_all` and `format_all` targets; docs: updated for new targets

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-08-07 11:57:32 +09:00
..
application.fam [FL-3057] Allow use of any suitable pin for 1-Wire devices (#2350) 2023-02-08 14:40:44 +09:00
example_thermo.c [FL-3867] Code formatting update (#3765) 2024-07-15 13:38:49 +09:00
example_thermo_10px.png Images linting: ensure that all images conform specification (#3802) 2024-08-07 11:57:32 +09:00
README.md [FL-870] Auto-generated firmware documentation take two (#2944) 2024-03-06 15:25:21 +09:00

1-Wire Thermometer

This example application demonstrates the use of the 1-Wire library with a DS18B20 thermometer. It also covers basic GUI, input handling, threads and localisation.

Source code

Source code for this example can be found here.

Electrical connections

Before launching the application, connect the sensor to Flipper's external GPIO according to the table below:

DS18B20 Flipper
VDD 9
GND 18
DQ 17

NOTE 1: GND is also available on pins 8 and 11.

NOTE 2: For any other pin than 17, connect an external 4.7k pull-up resistor to pin 9.

Launching the application

In order to launch this demo, follow the steps below:

  1. Make sure your Flipper has an SD card installed.
  2. Connect your Flipper to the computer via a USB cable.
  3. Run ./fbt launch APPSRC=example_thermo in your terminal emulator of choice.

Changing the data pin

It is possible to use other GPIO pin as a 1-Wire data pin. In order to change it, set the THERMO_GPIO_PIN macro to any of the options listed below:

/* Possible GPIO pin choices:
 - gpio_ext_pc0
 - gpio_ext_pc1
 - gpio_ext_pc3
 - gpio_ext_pb2
 - gpio_ext_pb3
 - gpio_ext_pa4
 - gpio_ext_pa6
 - gpio_ext_pa7
 - gpio_ibutton
*/

#define THERMO_GPIO_PIN (gpio_ibutton)

Do not forget about the external pull-up resistor as these pins do not have one built-in.

With the changes been made, recompile and launch the application again. The on-screen text should reflect it by asking to connect the thermometer to another pin.