Search found 1320 matches

by Roberthh
Tue Apr 23, 2019 2:27 pm
Forum: MicroPython pyboard
Topic: First Connect
Replies: 2
Views: 26

Re: First Connect

The problem lies in the caching of the file system by the PC. After modifying the files on Pyboard, make sure that all chnages are written back. You can do that by closing the disk on the PyBoard. On Linux systems, you can also run the command 'sync' . Mounting the PyBoard file system on a PC is so ...
by Roberthh
Tue Apr 23, 2019 11:53 am
Forum: Hardware Projects
Topic: How to expand the size of spiflash?
Replies: 4
Views: 44

Re: How to expand the size of spiflash?

If it is an ESP32, the magic is in modules/flashbdev.py. You get a larger file system, if you change it to the one below. Please note that only the last line is changed. import esp class FlashBdev: SEC_SIZE = 4096 START_SEC = esp.flash_user_start() // SEC_SIZE def __init__(self, blocks): self.blocks...
by Roberthh
Tue Apr 23, 2019 11:40 am
Forum: Hardware Projects
Topic: How to expand the size of spiflash?
Replies: 4
Views: 44

Re: How to expand the size of spiflash?

Which board are you using, and do you want to extend the file system?
by Roberthh
Tue Apr 23, 2019 9:39 am
Forum: General Discussion and Questions
Topic: square signal for buzzer
Replies: 4
Views: 51

Re: square signal for buzzer

For Arduino, the code in the sketch is the only that's running. Using Micropython, there are quite a few background tasks active, including the communication stack. This causes a "square" wave loop like yours not being regular and the average execution time per loop being extended. 85µs for a functi...
by Roberthh
Mon Apr 22, 2019 7:36 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

You can activate the built-in lowpass filter, by writing a value between b'\x00' and b'\x06' to memory address 0x1a, e.g. self.iic.writeto_mem(self.addr, 0x1a, b'\x06') 06 gives the strongest filter, slowing indeed responses. Using this setting, I captured some data sets with get_values(). The effec...
by Roberthh
Mon Apr 22, 2019 3:51 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

I updated the code. in one of my posts above. But here it is again: import machine class accel(): def __init__(self, i2c, addr=0x68): self.iic = i2c self.addr = addr self.iic.writeto(self.addr, bytearray([107, 0])) def get_raw_values(self): a = self.iic.readfrom_mem(self.addr, 0x3B, 14) return a def...
by Roberthh
Mon Apr 22, 2019 3:34 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

The sequence I used is: from machine import I2C, Pin from accel import accel # my I2C is connected to Pins 12 & 13 i2c= I2C(scl=Pin(12), sda=Pin(13)) mpu = accel(i2c) val = mpu.get_values() print(val) # or val = mpu.get_smoothed_values() print(val) And no, the values are not stable but have a lot of...
by Roberthh
Mon Apr 22, 2019 8:53 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

Just playing around with the MPU6050 class it looks as if creates reasonable normalized values.
by Roberthh
Mon Apr 22, 2019 8:30 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

If you call the file with the class accel mpy6050.py. then it is correct. attached is a version of the class accel with the methods calibrate() and get_smoothed_values() changes in a way of how I assumed its purpose. It looks as initially these functions were not intended as class members, but now t...
by Roberthh
Sun Apr 21, 2019 7:57 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

I edited the two scripts such that they run on my Wemos D1 Mini and return some useful results. By chance, I had a MPU6050 sensor. Please not that the methods calibrate() and get_smoothed_value() of accel.py are still wrong. They look unfinished and cause obvious errors when called. accel.py: import...