Search found 126 matches

by OlivierLenoir
Fri Jan 07, 2022 8:21 pm
Forum: General Discussion and Questions
Topic: Micropython online simulator
Replies: 1
Views: 5606

Re: Micropython online simulator

Very nice simulator.
I've tested it with a MPU6050. :D
Screenshot at 2022-01-07 21-20-08.png
Screenshot at 2022-01-07 21-20-08.png (238.22 KiB) Viewed 5566 times
by OlivierLenoir
Wed Jan 05, 2022 6:19 am
Forum: Programs, Libraries and Tools
Topic: paralel functions
Replies: 2
Views: 15391

Re: paralel functions

You can read Multicore Support in this document, chapter 3.5 . import time, _thread, machine def task(n, delay): led = machine.Pin(25, machine.Pin.OUT) for i in range(n): led.high() time.sleep(delay) led.low() time.sleep(delay) print('done') _thread.start_new_thread(task, (10, 0.5))
by OlivierLenoir
Thu Dec 30, 2021 10:00 am
Forum: Programs, Libraries and Tools
Topic: vehicle anti-theft device with movement detection - question
Replies: 2
Views: 7506

Re: vehicle anti-theft device with movement detection - question

Can you look this topic Detection if device is moving (in motion) or not?
It sounds similar to me.
by OlivierLenoir
Mon Dec 27, 2021 5:38 am
Forum: General Discussion and Questions
Topic: Accessing hardware from native .mpy code
Replies: 6
Views: 16788

Re: Accessing hardware from native .mpy code

Can you give us the i2c device reference you're using?
For i2c you can start with this documentation.
by OlivierLenoir
Tue Dec 21, 2021 9:57 pm
Forum: Programs, Libraries and Tools
Topic: Detection if device is moving (in motion) or not
Replies: 23
Views: 56567

Re: Detection if device is moving (in motion) or not

It's now time to apply standard score to MPU6050 gyro sensor to detect if we move. I reset cumulative gyro every 200 measures, it's because this method is not perfect, but to detect if we move it's acceptable. The same approach can be apply to acceleration sensor. # Created: 2021-12-19 11:06:43 # Li...
by OlivierLenoir
Tue Dec 21, 2021 9:12 pm
Forum: Programs, Libraries and Tools
Topic: Detection if device is moving (in motion) or not
Replies: 23
Views: 56567

Re: Detection if device is moving (in motion) or not

When reading MPU6050's raw data, while the sensor is static on a table, we can observe a Gaussian distribution (blue histogram) . We can standardize those data using standard score (orange histogram) . This simple standardization will be sufficient to code a simple motion detector with a MPU6050. I'...
by OlivierLenoir
Thu Dec 16, 2021 10:04 pm
Forum: Programs, Libraries and Tools
Topic: Detection if device is moving (in motion) or not
Replies: 23
Views: 56567

Re: Detection if device is moving (in motion) or not

...Sum those variations and you get the velocity... This is fine in physics textbooks. ... I agree with you Peter. I've been able to find, in my toolbox, a GY-521 MPU-6050 3-axis gyroscope and acceleration sensor. Here is a small test based on this excellent video . # Created: 2021-12-16 19:54:43 #...
by OlivierLenoir
Wed Dec 15, 2021 7:52 pm
Forum: Programs, Libraries and Tools
Topic: Detection if device is moving (in motion) or not
Replies: 23
Views: 56567

Re: Detection if device is moving (in motion) or not

If you consider that your sensor is static when powered on and that you are doing one acceleration measure per second you get the velocity variation . Sum those variations and you get the velocity. from utime import sleep # Init velocity at power on velocity = 0 # m/s period = 1 # second def get_acc...
by OlivierLenoir
Tue Dec 14, 2021 4:56 pm
Forum: Programs, Libraries and Tools
Topic: Detection if device is moving (in motion) or not
Replies: 23
Views: 56567

Re: Detection if device is moving (in motion) or not

Can you share with us, which 3-axis accelerometer and gyroscope sensor you are using?
by OlivierLenoir
Sun Dec 12, 2021 8:27 am
Forum: Programs, Libraries and Tools
Topic: Which are the best resources to learn python?
Replies: 1
Views: 5070

Re: Which are the best resources to learn python?

You can read this existing topic in the forum.