# Draw with Magnetometer

**URL:** <https://community.thunkable.com/t/draw-with-magnetometer/1079979>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [February 2, 2021, 5:17pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979 "2021-02-02T17:17:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![khaji.masoudp1](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@khaji.masoudp1](https://community.thunkable.com/u/khaji.masoudp1)\
**Post date:** [February 2, 2021, 5:17pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/1 "2021-02-02T17:17:01Z")

</div>

I have a project to draw a pattern on canvas by moving a magnet near the phone and using magnetometer blocks of codes.  
if anybody could help me with this it would be appreciated

---

<div class="post-metadata">

**Author:** ![secondaryaccount](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/secondaryaccount/32/91441_2.png) [@secondaryaccount](https://community.thunkable.com/u/secondaryaccount)\
**Post date:** [February 2, 2021, 6:22pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/2 "2021-02-02T18:22:38Z")

</div>

What have you created so far and what do you need help with?

---

<div class="post-metadata">

**Author:** ![khaji.masoudp1](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@khaji.masoudp1](https://community.thunkable.com/u/khaji.masoudp1)\
**Post date:** [February 2, 2021, 6:44pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/3 "2021-02-02T18:44:44Z")

</div>

I am a beginner and so far I have used the magnetometer blocks of codes but I don’t know how to see the flux density changes by placing a magnet toward the phone.  
I want to build an app that enables users to draw a pattern by using a magnet near the phone canvas to pick up the pattern on the phone screen. something exactly like this video.  
[https://youtu.be/fJlgDIO3oL8](https://youtu.be/fJlgDIO3oL8)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 2, 2021, 7:45pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/4 "2021-02-02T19:45:15Z")

</div>

Can you share a link to your project? That way someone can give advice or help you fix anything that’s not working.

---

<div class="post-metadata">

**Author:** ![khaji.masoudp1](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@khaji.masoudp1](https://community.thunkable.com/u/khaji.masoudp1)\
**Post date:** [February 2, 2021, 10:54pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/5 "2021-02-02T22:54:30Z")

</div>

yeah  
here is the link https://x.thunkable.com/copy/dfcb1bd87806095b24c895dcb3eebbb6  
in fact, I want to draw a pattern of the magnet that I am moving on top of the phone.  
I can see the changes in flux density screen when moving the magnet,  
but I don’t know how can I draw on the canvas.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 12, 2021, 12:11am UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/6 "2021-02-12T00:11:26Z")

</div>

> [@khaji.masoudp1](#):
>
> [Thunkable](https://x.thunkable.com/copy/dfcb1bd87806095b24c895dcb3eebbb6)

I’m not sure either. I tried these blocks and my phone vibrated in Thunkable Live but nothing appeared on the screen:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/d/8d82ffafc402ab02ddcd0802eec69a9a82b3da7a.png)

Ah, it needed the “When Canvas Loads” block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/c/0c841dcbf9c1a8d5e8d22901f219f20c69385799.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/7/875b96dd1ef23ba1a512bf008d6f404b16a8395b.png)

---

<div class="post-metadata">

**Author:** ![khaji.masoudp1](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@khaji.masoudp1](https://community.thunkable.com/u/khaji.masoudp1)\
**Post date:** [February 12, 2021, 12:20am UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/7 "2021-02-12T00:20:16Z")

</div>

Finally, I could figure it out,  
By activating sprite drawing and using x and y flux densities for sprite’s x and y inputs.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/a/2a9f85a0e7370cccd02248449336b527a17250de.png)  
Thank you for follow up

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:29pm UTC](https://community.thunkable.com/t/draw-with-magnetometer/1079979/8 "2024-11-08T13:29:38Z")

</div>


