# Screen Diagnostics This example app implements a simple shell to allow you to tinker with the display. You have access to all drawing functions from the _epd driver_, as well as system information, etc. There are also pre-programmed algorithms (e.g. `render_stairs`, `render_grid`) which can be used to find pixel errors or display incompatibilities. The `screen_diag` examples requires ESP-IDF v5.x or newer. ## Setup Don't forget to set your display type in `epd_init` in `epd.c`! First you need to flash the firmware: ```sh idf.py flash ``` After that, you can enter the shell environment with: ```sh idf.py monitor ``` Please note the [known issues](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/tools/idf-monitor.html#known-issues-with-idf-monitor) of the IDF Monitor for limitations. ## Usage You can get a full list (see below) of all available commands with: `help`. ``` system_restart Restarts the system. free_heap_size Returns the free heap size. dump_heaps_info [] Dumps heap information of all heaps matching the capability. Heap caps to print. Default: MALLOC_CAP_DEFAULT dump_tasks Dumps all tasks with their names, current state and stack usage. chip_info Dumps chip information. firmware_info Dumps information about the ESP-IDF and the firmware. get_time Returns the time in microseconds since boot. get_mac [] Returns the MAC address for the given interface or the pre-programmed base address. Either "wifi_station", "wifi_ap", "bluetooth" or "ethernet" get_rotation Get current screen rotation. set_rotation [--inverted] Changes screen rotation. screen rotation: "horizontal" or "portrait" --inverted get_width Print screen width. get_height Print screen height. get_pixel Get pixel color in front buffer. x position y position set_pixel [] Set pixel color in front buffer. x position y position color. default value: 0 (0x00) clear_screen Clear the entire screen and reset the front buffer to white. full_clear_screen Same as clear_screen, but also tries to get rid of any artifacts by cycling through colors on the screen. get_temp Returns the ambient temperature. power_on Turns on the power of the display. power_off Turns off the power of the display. draw_hline [] Draw horizontal line. start x position start y position length of the line default value: 0x00 draw_vline [] Draw vertical line. start x position start y position length of the line default value: 0x00 draw_line [] Draw line between two points. start x position start y position end x position end y position default value: 0x00 draw_rect [] Draw a rectangle. top left x position top left y position square width square height default value: 0x00 fill_rect [] Draw a filled rectangle. top left x position top left y position square width square height default value: 0x00 draw_circle [] Draw a circle. center x position center y position circle radius default value: 0x00 fill_circle [] Draw a filled circle. center x position center y position circle radius default value: 0x00 draw_triangle [] Draw a triangle from three different points. first edge x position first edge y position second edge x position second edge y position third edge x position third edge y position default value: 0x00 fill_triangle [] Draw a filled triangle from three different points. first edge x position first edge y position second edge x position second edge y position third edge x position third edge y position default value: 0x00 write_text [-s] [] Write text message to the screen using the sans-serif font by default. x position y position default value: 0x00 -s, --serif Use serif font rather than sans-serif. Text to be printed. render_stairs [] [] [] Render multiple diagonal lines across the screen. angle by which each diagonal line is drawn. default value: 3 thickness of each diagonal line. default value: 100 default value: 0x00 render_grid [] [] Renders a grid across the whole screen. At a certain gutter size, cell info will be printed as well. default value: 75 default value: 0x00 help Print the list of registered commands ```