# Scrollbox widgets and sensor connecting

**URL:** <http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764>\
**Category:** How to\
**Created:** [April 2, 2024, 8:20pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764 "2024-04-02T20:20:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDog1600](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@BDog1600](http://forum.squareline.io/u/BDog1600)\
**Post date:** [April 2, 2024, 8:20pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/1 "2024-04-02T20:20:34Z")

</div>

I have a Arduino Giga Shield and R1. What flags or events are needed to enable a scroll box to work with a sensor? What code would be used to make this happen?

---

<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:** [April 2, 2024, 11:47pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/2 "2024-04-02T23:47:48Z")

</div>

Scrollable flags ([Inspector | SquareLine Studio](https://docs.squareline.io/docs/dev_env/inspector/#scroll-flags)) are needed to be checked. The wished-to-scroll object’s size should be bigger than its container for the scrollbars to appear and operate. Hopefully you have the touch-panel’s driver and your input sends the data to LVGL. There are some Arduino Giga Shield projects mentioned here, some people use SquareLine Studio’s Arduino-TFT\_eSPI as a starting point, but it’s also worth to check for example codes elsewhere, like Arduino or LVGL forum.

---

<div class="post-metadata">

**Author:** ![BDog1600](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@BDog1600](http://forum.squareline.io/u/BDog1600)\
**Post date:** [April 13, 2024, 3:25pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/3 "2024-04-13T15:25:25Z")

</div>

These are the option for flags in the Scrollbox settings.

 ![image](http://forum.squareline.io/uploads/default/original/2X/c/c670f34dcc6a64509e364bed34086ac16a147a01.jpeg)

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [April 13, 2024, 3:44pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/4 "2024-04-13T15:44:55Z")

</div>

You must be more specific. If sensor you mean touch panel on LCD right configured work without any setup here. But if sensor you mean encoder indev, then some code and knowledge required to do.  
And primary what you mean as scrollbox, i dont see an here

 ![image](http://forum.squareline.io/uploads/default/original/2X/2/29d395ce6a01505e05bdbc86855a6d0c6fc25955.png)

---

<div class="post-metadata">

**Author:** ![BDog1600](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@BDog1600](http://forum.squareline.io/u/BDog1600)\
**Post date:** [April 13, 2024, 3:52pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/5 "2024-04-13T15:52:08Z")

</div>

I would like the spinbox to change value when an ir sensor senses something.

It looks like I might have to set the parent as scrollable

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [April 13, 2024, 4:07pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/6 "2024-04-13T16:07:12Z")

</div>

This have nothink todo with scroll. Read [Spinbox (lv\_spinbox) — LVGL documentation](https://docs.lvgl.io/master/widgets/spinbox.html)  
or write what you realy plan do.

---

<div class="post-metadata">

**Author:** ![BDog1600](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@BDog1600](http://forum.squareline.io/u/BDog1600)\
**Post date:** [April 13, 2024, 4:15pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/7 "2024-04-13T16:15:47Z")

</div>

So Scrollbox might not be the widget to use then, please forgive my lack of knowledge here as I try to navigate this. I want to display a value that changes value when a sensor detects a ball passing through a hole.

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [April 13, 2024, 4:35pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/8 "2024-04-13T16:35:22Z")

</div>

You can show info as graphics or text. Your explain is text then use label and update it after new value from sensor received.

---

<div class="post-metadata">

**Author:** ![BDog1600](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@BDog1600](http://forum.squareline.io/u/BDog1600)\
**Post date:** [April 13, 2024, 6:34pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/9 "2024-04-13T18:34:02Z")

</div>

The update after new value received would be a flag and event?

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [April 13, 2024, 7:26pm UTC](http://forum.squareline.io/t/scrollbox-widgets-and-sensor-connecting/2764/10 "2024-04-13T19:26:46Z")

</div>

This type of updates cant be handled from Squareline design. You dont write about your system, then we cant … example for arduino

```auto
void loop()
{
...
lv_timer_handler();
delay(5);
...
if(any event source) {
newval=getsensorvalue(); //not slow less as 1ms
lv_label_set_text_fmt(label, "Value: %d", newval);
}
}

```
