<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.recessim.com/w/index.php?action=history&amp;feed=atom&amp;title=Whirlybird%2FIMU</id>
	<title>Whirlybird/IMU - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.recessim.com/w/index.php?action=history&amp;feed=atom&amp;title=Whirlybird%2FIMU"/>
	<link rel="alternate" type="text/html" href="https://wiki.recessim.com/w/index.php?title=Whirlybird/IMU&amp;action=history"/>
	<updated>2026-05-14T14:57:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.recessim.com/w/index.php?title=Whirlybird/IMU&amp;diff=2699&amp;oldid=prev</id>
		<title>-.-6eau at 20:56, 9 October 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.recessim.com/w/index.php?title=Whirlybird/IMU&amp;diff=2699&amp;oldid=prev"/>
		<updated>2024-10-09T20:56:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:56, 9 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Main project page [[Whirlybird]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== BNO080 ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== BNO080 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sample obtained from Circuit Launch community surplus racks.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sample obtained from Circuit Launch community surplus racks.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key RECESSIM:diff::1.12:old-2698:rev-2699 --&gt;
&lt;/table&gt;</summary>
		<author><name>-.-6eau</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.recessim.com/w/index.php?title=Whirlybird/IMU&amp;diff=2698&amp;oldid=prev</id>
		<title>-.-6eau: compass test</title>
		<link rel="alternate" type="text/html" href="https://wiki.recessim.com/w/index.php?title=Whirlybird/IMU&amp;diff=2698&amp;oldid=prev"/>
		<updated>2024-10-09T20:55:13Z</updated>

		<summary type="html">&lt;p&gt;compass test&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== BNO080 ==&lt;br /&gt;
Sample obtained from Circuit Launch community surplus racks.&lt;br /&gt;
&lt;br /&gt;
https://learn.sparkfun.com/tutorials/qwiic-vr-imu-bno080-hookup-guide/all&lt;br /&gt;
&lt;br /&gt;
=== compass.py ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# BNO08x Micropython I2C Library &amp;amp; Test&lt;br /&gt;
#  derived from Adafruit CircuitPython &amp;amp; Dobodu&lt;br /&gt;
#  https://github.com/dobodu/BOSCH-BNO085-I2C-micropython-library/blob/main/lib/bno08x_i2c.py&lt;br /&gt;
# Updates to integrate with whilrlybird DF'n by DEFAULT&lt;br /&gt;
&lt;br /&gt;
from machine import I2C, Pin&lt;br /&gt;
import time&lt;br /&gt;
from time import sleep_ms&lt;br /&gt;
import math&lt;br /&gt;
from bno08x_i2c import *&lt;br /&gt;
import neopixel&lt;br /&gt;
&lt;br /&gt;
NEO_COUNT = 32&lt;br /&gt;
NEO_DELAY = 50&lt;br /&gt;
&lt;br /&gt;
np = neopixel.NeoPixel(Pin(44), NEO_COUNT, bpp=4)&lt;br /&gt;
&lt;br /&gt;
I2C1_SDA = Pin(5)&lt;br /&gt;
I2C1_SCL = Pin(4)&lt;br /&gt;
&lt;br /&gt;
def rgbw(p):&lt;br /&gt;
 np[p] = (0, 0, 0, 1)&lt;br /&gt;
 np.write()&lt;br /&gt;
 sleep_ms(NEO_DELAY)&lt;br /&gt;
&lt;br /&gt;
def ring():&lt;br /&gt;
 for i in range(24,32):&lt;br /&gt;
  rgbw(i)&lt;br /&gt;
  np.fill((0,0,0,0))&lt;br /&gt;
  np.write()&lt;br /&gt;
 for i in range(23,-1, -1):&lt;br /&gt;
  rgbw(i)&lt;br /&gt;
 np.fill((0,0,0,0))&lt;br /&gt;
 np.write()&lt;br /&gt;
&lt;br /&gt;
ring()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i2c1 = I2C(1, scl=I2C1_SCL, sda=I2C1_SDA, freq=100000, timeout=200000 )&lt;br /&gt;
#print(&amp;quot;I2C Device found at address : &amp;quot;,i2c1.scan(),&amp;quot;\n&amp;quot;)&lt;br /&gt;
bno = BNO08X_I2C(i2c1, debug=False)&lt;br /&gt;
print(&amp;quot;BNO08x I2C connection : Done\n&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
bno.enable_feature(BNO_REPORT_ACCELEROMETER)&lt;br /&gt;
bno.enable_feature(BNO_REPORT_GYROSCOPE)&lt;br /&gt;
#bno.enable_feature(BNO_REPORT_GEOMAGNETIC_ROTATION_VECTOR)&lt;br /&gt;
#bno.enable_feature(BNO_REPORT_MAGNETOMETER)&lt;br /&gt;
bno.enable_feature(BNO_REPORT_ROTATION_VECTOR)&lt;br /&gt;
#bno.enable_feature(BNO_REPORT_ACTIVITY_CLASSIFIER)&lt;br /&gt;
#bno.enable_feature(BNO_REPORT_STABILITY_CLASSIFIER)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;BNO08x sensors enabling : Done\n&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def tilt():&lt;br /&gt;
#26/30 left/right, 28/31 down/up&lt;br /&gt;
 x,y,z = bno.acceleration&lt;br /&gt;
 np.fill((0,0,0,0))&lt;br /&gt;
 if x &amp;lt; -1:&lt;br /&gt;
  np[26] = (int(x*-3),0,0,0)&lt;br /&gt;
 elif x &amp;gt; 1:&lt;br /&gt;
  np[30] = (int(x*3),0,0,0)&lt;br /&gt;
 if y &amp;lt; -1:&lt;br /&gt;
  np[31] = (0,int(y*-3),0,0)&lt;br /&gt;
 elif y &amp;gt; 1:&lt;br /&gt;
  np[28] = (0,0,int(y*3),0)&lt;br /&gt;
 #print(&amp;quot;X: %0.6f\tY: %0.6f\tZ: %0.6f&amp;quot; % (x,y,z))&lt;br /&gt;
&lt;br /&gt;
def turn():&lt;br /&gt;
 x,y,z = bno.euler&lt;br /&gt;
 r = z + 180 - 13&lt;br /&gt;
 if r &amp;lt; 0:&lt;br /&gt;
  r += 360&lt;br /&gt;
 #print(z,r)&lt;br /&gt;
 np[int(r/15)] = (0,0,0,5)&lt;br /&gt;
 np.write()&lt;br /&gt;
&lt;br /&gt;
def classifier():&lt;br /&gt;
 print(bno.stability_classification, bno.activity_classification[&amp;quot;most_likely&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
def loop():&lt;br /&gt;
 while True:&lt;br /&gt;
  tilt()&lt;br /&gt;
  turn()&lt;br /&gt;
  #classifier()&lt;br /&gt;
  sleep_ms(50)&lt;br /&gt;
&lt;br /&gt;
loop()&lt;br /&gt;
&lt;br /&gt;
#cpt = 0&lt;br /&gt;
&lt;br /&gt;
#while True:&lt;br /&gt;
#    time.sleep(0.5)&lt;br /&gt;
#    cpt += 1&lt;br /&gt;
#    geo_x, geo_y, geo_z, geo_w = bno.geomagnetic_quaternion&lt;br /&gt;
#    mag_x, mag_y, mag_z = bno.magnetic  # pylint:disable=no-member&lt;br /&gt;
#    heading = math.atan2(mag_x, mag_y) * 180 / math.pi&lt;br /&gt;
&lt;br /&gt;
#    print(&amp;quot;%0.f Geo\tX: %0.6f\tY: %0.6f\tZ: %0.6f\tW: %0.6f\tMag X: %0.6f\tY: %0.6f\tZ: %0.6f\tuT %d&amp;quot; % (heading, geo_x, geo_y, geo_z, geo_w, mag_x, mag_y, mag_z, cpt))&lt;br /&gt;
    #if cpt == 10 :&lt;br /&gt;
    #    bno.tare&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#    print(&amp;quot;cpt&amp;quot;, cpt)&lt;br /&gt;
#    accel_x, accel_y, accel_z = bno.acceleration  # pylint:disable=no-member&lt;br /&gt;
#    print(&amp;quot;Acceleration\tX: %0.6f\tY: %0.6f\tZ: %0.6f\tm/s²&amp;quot; % (accel_x, accel_y, accel_z))&lt;br /&gt;
#    gyro_x, gyro_y, gyro_z = bno.gyro  # pylint:disable=no-member&lt;br /&gt;
#    print(&amp;quot;Gyroscope\tX: %0.6f\tY: %0.6f\tZ: %0.6f\trads/s&amp;quot; % (gyro_x, gyro_y, gyro_z))&lt;br /&gt;
&lt;br /&gt;
#    quat_i, quat_j, quat_k, quat_real = bno.quaternion  # pylint:disable=no-member&lt;br /&gt;
#    print(&amp;quot;Rot Vect Quat\tI: %0.6f\tJ: %0.6f\tK: %0.6f\tReal: %0.6f&amp;quot; % (quat_i, quat_j, quat_k, quat_real))&lt;br /&gt;
#    R, T, P = bno.euler&lt;br /&gt;
#    print(&amp;quot;Euler Angle\tX: %0.1f\tY: %0.1f\tZ: %0.1f&amp;quot; % (R, T, P))&lt;br /&gt;
#    print(&amp;quot;&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>-.-6eau</name></author>
		
	</entry>
</feed>