Search found 5 matches

by JonatanESalinas
Tue Mar 09, 2021 4:29 pm
Forum: Development of MicroPython
Topic: Which I2C functions should I use to create a user C module for MPU6050?
Replies: 2
Views: 1980

Re: Which I2C functions should I use to create a user C module for MPU6050?

pythoncoder wrote:
Tue Mar 09, 2021 7:38 am
See this existing MPU6050 library.
Thank you! But this is a micropython module, what I want to do is to write a user C module (for educational purposes) for the MPU6050 for my custom board, and I don't know exactly which I2C functions should I use to make this.
by JonatanESalinas
Tue Mar 09, 2021 1:11 am
Forum: Development of MicroPython
Topic: Which I2C functions should I use to create a user C module for MPU6050?
Replies: 2
Views: 1980

Which I2C functions should I use to create a user C module for MPU6050?

Hi, I'm trying to write a user C module to use a MPU6050 in my custom board. This custom board has a STM32F407VGT6 MCU on it. I want to write data to the MPU6050 and read data from it, using I2C functions. Where is a good place to start looking? I've seen the file i2c.c and its functions (i2c_write,...
by JonatanESalinas
Thu Mar 04, 2021 11:26 pm
Forum: Development of MicroPython
Topic: How to configure pin behavior inside a custom C module?
Replies: 3
Views: 2154

Re: How to configure pin behavior inside a custom C module?

Ok, I solved this issue, I used:

Code: Select all

mp_hal_pin_config(pin_C2, MP_HAL_PIN_MODE_INPUT, MP_HAL_PIN_PULL_UP, 0);
For each of the pins of my buttons, which specifies that I want a PULL_UP configuration, instead of only:

Code: Select all

mp_hal_pin_input(pin_C2);
That solved my problem :) , but thanks anyway!!
by JonatanESalinas
Wed Mar 03, 2021 9:13 pm
Forum: Development of MicroPython
Topic: How to configure pin behavior inside a custom C module?
Replies: 3
Views: 2154

Re: How to configure pin behavior inside a custom C module?

Thanks for your answer! I know this isn't particularly helpful, but other than for educational purposes, I'm not sure why you'd want to do this. Well yes, I want to do this for educational purposes, I want to learn how to do this. One good place to look to start would be drivers/dht/dht.c -- it uses...
by JonatanESalinas
Wed Feb 24, 2021 8:18 pm
Forum: Development of MicroPython
Topic: How to configure pin behavior inside a custom C module?
Replies: 3
Views: 2154

How to configure pin behavior inside a custom C module?

Hi, I'm trying to create a custom C module for Micropython, for my custom board. This custom board works with a STM32F407VGT6; and has 4 push buttons on it, attached to specific pins of the MCU. Right now I have a Python file, which contains a class that allows me to work with the buttons of my boar...