also give a look at the data sheet , you can round the readings also to help conversion.
you can use a Kalman Filter also to give pitch and Yaw from the raw readings.
HTH
GL PJ
in IMU Capture the same float readings are used as in the high level examples.
I like the Low level approach, because with one call I get integer values for x and y
One g is 4000. In my application, the max value expected is 3 g, so 12000, OK as integer.
But the problem remains, time issues are corrupted when the acceleration calls have been made.
I will try to isolate the sensor call in a separate function. But that will have to wait until next week, I have to take care of my grandsonā¦
Hi there,
Yes Good to know the Low level gets it done, You have any other devices connected? Those pins are for I2C communication with those devices. You can also enable a time stamp that is in the IMU presented with the readings. So maybe look there if high precision for timing is needed.
Read over the Data Sheet for the LSM6DS3 during the down time and check out all the things it does as well.
Look at this thread, by Msfujino. Thereās a lot in there but well documented.
HTH
GL PJ
ps. Iām having fun with my Nephews, 12,10, 7ā¦ I showed them the 3D printer and we printed some darth vaders, storm trooper and spiderman head,etc. I think 1 of the three is destin to be an engineer.
Stil no progress.
Changed the output pin from 4 to 0. Pin 5 not used any more.
Measured acceleration values are perfect, but delays and mills() vary wildly, as soon as the Bluetooth software is used.
The bluetooth communication works very nice, but it messes up all time issues.
Am I really the first person to use BT and IMU at the same time?
I hope I do not have to throw away the Xiao Sensesā¦
Rads,
Hi there,
Without seeing the actual Code in Question, Perhaps you need an additional LIB installed for RTC or interrupts.?
are you using the builtin TimeStamp function?
HTH
GL PJ
is there anything to control the timers? In the past, in Assembler you had complete control of the 2 Microchip timersā¦
There is no difference between using multiple delayMicroseconds and using millis(). (unsigned long).
Just to clarify: I have to generate a servo pulse with a frequency of 125 Hz (8 ms for one complete pulse). The HIGH duration is calculated when the servo signal is LOW. During this LOW time, I measure the x and y values two times (3 ms separated), calculate the averages, and calculate the duration of the next HIGH duration.
So, I cannot use the Arduino servo library.
The problem is, that the calculations are OK, but on the scope I see that the HIGH and LOW durations now and then are exceeded for one to two ms, but not constantlyā¦
Hi there,
Without Seeing the code, I canāt offer much help.
Yes, There is an Interrupts Library and a Timer Library both for Nrf52840 , I donāt have links but you can search here for the examples folks have posted. Sounds like that is what you need.
HTH
GL PJ
Yes, the example blink_print in the timer library is interesting. But I do not understand the toggle principle.
My timer needs pulse of 1 to 2 ms. Then, in the LOW time, the duration of the next pulse is calculated.
Then, after 8 ms since the beginning of the first pulse, everything happens again.
Could you lease look at that sketch, and give me an indication for the solution?
Kind regards,
Hi there,
LOL, man I vaguely remember some Fortran77 back in the 80"s ? Punch cards too. WOW
The Nrf52840 has Several timers and the PWMās You can use either.
to achieve the outcome, Check out how Arduino generates Pulses link
Basically set the pulse length, attach an Interrupt, In the ISR reset the timer value start the duty cycle timer with interrupt and rinse and repeat.
like this one, itās also applicable to Xiao.
HTH
GL PJ
Iāll look at the blink_print time permitting and make some comments.
Thanks for the suggestions,
The TimerOne library looked perfect, but it seems not to work with my Xiao Sense, The examples will not compileā¦
Tried also to change the frequency of the Servo library. Was not able to change the Refresh Interval to 8000 instead of 20000ā¦ Still stuckā¦
Hi there,
Have you tried the other BSP? In the board selection Pick the second one. What is the BSP that is NOT compiling? Look at compiler output and see which it is.?
HTH
GL PJ
Hi there,
Yes thatās not uncommon for older setups, and thatās for an AVR.
Try this one and youāll see the Seeed board is called out and supported , BSP 1.0.X
Coming nearer.
Modifying TimerInterruptLEDDemo, I could use one timer for a short blink, following by a second timer for a longer pause.
But this sketch is only in milliseconds, and I need the first timer in microsecondsā¦
Suggestion?