# Example Optical Flow Code (Drone Stabilisation)

**URL:** <https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063>\
**Category:** micro:bit\
**Created:** [April 11, 2022, 5:30pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063 "2022-04-11T17:30:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blu](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@blu](https://forum.makecode.com/u/blu)\
**Post date:** [April 11, 2022, 5:30pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063/1 "2022-04-11T17:30:05Z")

</div>

Hello Everybody,

I would really like some help please with identifying which optical flow sensor is being used with the following code I found:

[[https://makecode.microbit.org/93888-97269-06615-24867](https://makecode.microbit.org/93888-97269-06615-24867)]([https://Optical](https://Optical) Flow)

There are quite a few different sensors available but I can’t so far (easily) identify which is being used in this code.

Thank you for any help!

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [April 12, 2022, 4:39pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063/2 "2022-04-12T16:39:38Z")

</div>

It looks like it might be an ADNS-3080.

---

<div class="post-metadata">

**Author:** ![blu](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@blu](https://forum.makecode.com/u/blu)\
**Post date:** [April 12, 2022, 5:53pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063/3 "2022-04-12T17:53:08Z")

</div>

Hi!

Thanks for your answer. I wondered about that myself as it seems quite popular on Arduino at least and pretty available.

I need to look more closely at spi communication I think to see if the code matches that particular sensor. Do you have any particular reasons for thinking it’s ADNS-3080 please?

Appreciate it.

👍

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [April 12, 2022, 7:33pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063/4 "2022-04-12T19:33:50Z")

</div>

Hi @blu,

That’s what I did — I looked at _some_ of the SPI usage, the variable names, and the registers/concepts in the ADNS-3080 data sheet. Things seem to line-up. Since the ADNS-3080 seems like a commonly available sensor with wide use in the Arduino community, it seems like a good candidate.

I didn’t check everything nor did I look to see if there were other sensors in the same family as the ADNS-3080 that may have the same registers. I’ll leave the rest to you 🙂!

---

<div class="post-metadata">

**Author:** ![blu](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@blu](https://forum.makecode.com/u/blu)\
**Post date:** [April 12, 2022, 9:26pm UTC](https://forum.makecode.com/t/example-optical-flow-code-drone-stabilisation/13063/5 "2022-04-12T21:26:10Z")

</div>

Hi @bsiever Ok, much appreciated. I haven’t looked at the datasheet yet. That’s a good idea.

Thanks so much 🙂
