# Background color change with accelerometer

**URL:** https://discourse.processing.org/t/background-color-change-with-accelerometer/15443
**Category:** Coding Questions
**Created:** [November 13, 2019, 2:42am UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443 "2019-11-13T02:42:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rhgrafix](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rhgrafix/32/7094_2.png) [@rhgrafix](https://discourse.processing.org/u/rhgrafix)
#### Post date: [November 13, 2019, 2:42am UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443/1 "2019-11-13T02:42:15Z")

</div>

Can anyone get  
[https://p5js.org/examples/mobile-acceleration-color.html](https://p5js.org/examples/mobile-acceleration-color.html)  
to work? I’ve tried it on multiple devices that have accelerometers and the background color does not change with movement,  
Thanks,  
R.L. Hamm

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 13, 2019, 2:58am UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443/2 "2019-11-13T02:58:27Z")

</div>

> [@rhgrafix](#):
>
> not change with movement

good, means you have updated systems and browser…

as

> per default:  
> it should not be possible that any webpage  
> can spy on your ( device ) movement.

now how about your device settings?  
did you enable that sensor for the browser? and that page?

---

<div class="post-metadata">

### Author: ![rhgrafix](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rhgrafix/32/7094_2.png) [@rhgrafix](https://discourse.processing.org/u/rhgrafix)
#### Post date: [November 13, 2019, 3:07am UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443/3 "2019-11-13T03:07:35Z")

</div>

That must be something unique to that page, I’ve never heard of giving a web page special access to my accelerometer, how can it be a security breach for them to know how my phone is tilted? I can’t even find info on how to give them rights to have this happen as I’ve never had the sensors not work anywhere, this is new to me. How do I get around this?  
Thanks

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [November 22, 2019, 5:21pm UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443/4 "2019-11-22T17:21:44Z")

</div>

> [@rhgrafix](#):
>
> I’ve tried it on multiple devices that have accelerometers and the background color does not change with movement,

I loaded the webpage on a recent Android phone and pressed “Run”. Nothing happened. I then pressed “Display sketch” and the sketch became visible in the window – its background was correctly responding to acceleration when I shook the phone.
