Search found 3314 matches

by pythoncoder
Tue Apr 23, 2019 5:40 pm
Forum: Other Boards
Topic: The 'machine' module on Raspberry Pi
Replies: 1
Views: 19

Re: The 'machine' module on Raspberry Pi

As I understand it buildroot has the option of installing a Linux kernel, filesystem and bootloader. If you plan to use it in that mode I'd try the official Unix build. However this does not support machine . Otherwise I guess you'll need to skip the Linux OS options and build one of the baremetal p...
by pythoncoder
Tue Apr 23, 2019 5:29 pm
Forum: General Discussion and Questions
Topic: square signal for buzzer
Replies: 4
Views: 51

Re: square signal for buzzer

Indeed. If I were presenting the topic I'd illustrate the C code, straight Python as per your sample, and timer-driven Python to illustrate a way to achieve high frequency precision. In the latter solution any latency in issuing the callback is cancelled out because it is the same for each output tr...
by pythoncoder
Tue Apr 23, 2019 9:12 am
Forum: ESP8266 boards
Topic: ESP-01, where are boot.py and main.py?
Replies: 4
Views: 105

Re: ESP-01, where are boot.py and main.py?

You may be able to run MicroPython modules as frozen bytecode but I'd certainly choose a better ESP8266 for development before porting the code to the ESP-01.
by pythoncoder
Tue Apr 23, 2019 8:10 am
Forum: ESP32 boards
Topic: Waveshare e-paper display how to rotate?
Replies: 1
Views: 153

Re: Waveshare e-paper display how to rotate?

From looking at @mcauser's code, the set_rotate method will only work if you use EPD methods for drawing objects. The display_frame method assumes that the passed buffers already have the correct orientation. You are using framebuf methods which is effectively bypassing the EPD's rotation mechanism.
by pythoncoder
Tue Apr 23, 2019 8:00 am
Forum: General Discussion and Questions
Topic: square signal for buzzer
Replies: 4
Views: 51

Re: square signal for buzzer

Please note I have no experience of programming the micro:bit. The 15% reduction corresponds to a function call overhead of 85μs. This is slow compared to the Pyboards but probably reflects the micro:bit hardware performance. On Pyboards and many other MicroPython platforms it is possible to achieve...
by pythoncoder
Tue Apr 23, 2019 7:18 am
Forum: ESP8266 boards
Topic: ESP-01, where are boot.py and main.py?
Replies: 4
Views: 105

Re: ESP-01, where are boot.py and main.py?

I seem to remember that the ESP8266 with 512K flash has too little Flash memory to support a filesystem.
by pythoncoder
Tue Apr 23, 2019 6:33 am
Forum: General Discussion and Questions
Topic: Newbie question
Replies: 1
Views: 33

Re: Newbie question

The Pyboard D is quite new so the firmware is the latest daily build. Despite it being a new design it has been thoroughly tested. I have had two for a while and they work well and it has many other users. Normal Python code runs perfectly. However I would recommend updating the firmware periodicall...
by pythoncoder
Tue Apr 23, 2019 6:21 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

@samerou If you're using an MPU6050 you don't need the mpu9150 or mpu9250 modules. You need imu.py and vector3d.py only. MPU6050 is the base class for the more complex sensors, and is implemented in imu.py . You should be able to issue: import machine from imu import MPU6050 i2c = machine.I2C(args_f...
by pythoncoder
Mon Apr 22, 2019 8:25 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 14
Views: 357

Re: Gyro/Mpu_Calibration "ESP8266"

@samerou Perhaps you could explain what you're trying to achieve. There is an established driver for the MPU6050 here. If your aim is to write a simplified version I'd suggest starting with the proven code and removing features you don't require.
by pythoncoder
Sat Apr 20, 2019 6:50 am
Forum: General Discussion and Questions
Topic: Function missing 1 required positional arguments error on esp32
Replies: 3
Views: 110

Re: Function missing 1 required positional arguments error on esp32

You are right except that for a single byte conversion the byte order is immaterial: it controls the ordering of multiple bytes, not the bit significance of individual bits.

Code: Select all

>>> (12).to_bytes(1,'big')
b'\x0c'
>>> (12).to_bytes(1,'little')
b'\x0c'
>>>