# How to Change Screens Programmatically

**URL:** <http://forum.squareline.io/t/how-to-change-screens-programmatically/3842>\
**Category:** How to\
**Created:** [September 24, 2024, 12:58am UTC](http://forum.squareline.io/t/how-to-change-screens-programmatically/3842 "2024-09-24T00:58:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpena2087](http://forum.squareline.io/letter_avatar_proxy/v4/letter/g/c68b51/32.png) [@gpena2087](http://forum.squareline.io/u/gpena2087)\
**Post date:** [September 24, 2024, 12:58am UTC](http://forum.squareline.io/t/how-to-change-screens-programmatically/3842/1 "2024-09-24T00:58:50Z")

</div>

### What do you want to achieve?

When my device starts an OTA update (ElegantOTA) Change to the OTA screen with a moving progress bar. (The progress bar works when I make OTAScreen #1 in Squareline so I know it’s not blocking code.

### What have you tried so far?

```auto
void onOTAStart() {
 Serial.println("OTA update started!");
lv_scr_load(ui_OTAScreen); // Assuming ui_OTAScreen is the name of your OTA update screen object
}

```

### Screenshot or video

### Others

- **SquareLine Studio version:**
- **Operating system:**
- **Target hardware:**

---

<div class="post-metadata">

**Author:** ![Hermit](http://forum.squareline.io/user_avatar/forum.squareline.io/hermit/32/971_2.png) [@Hermit](http://forum.squareline.io/u/Hermit)\
**Post date:** [September 24, 2024, 6:35am UTC](http://forum.squareline.io/t/how-to-change-screens-programmatically/3842/2 "2024-09-24T06:35:34Z")

</div>

This simple function above seems OK and it should work. (It should change the screen.)
