Search found 211 matches

by jimmo
Sun Jun 16, 2019 5:47 pm
Forum: Programs, Libraries and Tools
Topic: Call method and passed as a parameter
Replies: 5
Views: 78

Re: Call method and passed as a parameter

Is your scan method indented the same as __init__ ? (i.e. the same number of spaces in front of it). Sorry I can't tell because the formatting is lost.

When you past code into the forum, select it and then press the </> button so the formatting is preserved.
by jimmo
Sun Jun 16, 2019 5:43 pm
Forum: ESP32 boards
Topic: Problem compiling code
Replies: 3
Views: 35

Re: Problem compiling code

Is your system default python (and pip) the same as what the buiild uses?
by jimmo
Sun Jun 16, 2019 11:53 am
Forum: ESP32 boards
Topic: Problem compiling code
Replies: 3
Views: 35

Re: Problem compiling code

Makefiles are weird and mysterious.

In your `makefile`, the following line

Code: Select all

ESPIDF = $(HOME)/ESP32/esp/esp-idf #<path to root of esp-idf repository>
is equivalent to:

Code: Select all

ESPIDF = "$(HOME)/ESP32/esp/esp-idf "
So I guess either put no space before the #, or remove the comment entirely.
by jimmo
Sun Jun 16, 2019 10:48 am
Forum: Programs, Libraries and Tools
Topic: Call method and passed as a parameter
Replies: 5
Views: 78

Re: Call method and passed as a parameter

Inside `def scan()`, it refers to self.i2c, but you in `__init__`, the code never sets `self.i2c`. So you need to change it to: class rfd77(object): def __init__ (self , data, clock): self.clock = clock self.data = data i2c = I2C(-1, scl=Pin(self.clock), sda=Pin(self.data), freq=400000) print(clock)...
by jimmo
Sun Jun 16, 2019 2:03 am
Forum: Programs, Libraries and Tools
Topic: Test-Driven Development (TDD)
Replies: 1
Views: 57

Re: Test-Driven Development (TDD)

Hi, There's a unit testing library in micropython-lib which may be of some use to you. https://github.com/micropython/micropython-lib/tree/master/unittest (You should be able to install it with upip on your ESP32) >>> import upip >>> upip.install('unittest') Have a look at e.g. https://github.com/mi...
by jimmo
Sat Jun 15, 2019 1:25 pm
Forum: Other Boards
Topic: [Black STM32F407VET6] Pin map
Replies: 7
Views: 94

Re: [Black STM32F407VET6] Pin map

Which board definition are you using? If it's https://github.com/mcauser/BLACK_F407VE then it should even just work directly using what's printed on the board as e.g. machine.Pin('PA10') or machine.Pin.board.PA10 Can you run dir on machine.Pin.cpu / machine.Pin.board (this is the output for my Pyboa...
by jimmo
Sat Jun 15, 2019 1:20 pm
Forum: Other Boards
Topic: [Black STM32F407VET6] Pin map
Replies: 7
Views: 94

Re: [Black STM32F407VET6] Pin map

I found a blurry photo of that board, looks like they're labelled with their "CPU" names (like you say -- P<port><num>).

The easiest way to use them is machine.Pin.cpu.<port><num> (or machine.Pin('<port><num>')
by jimmo
Sat Jun 15, 2019 1:16 pm
Forum: Other Boards
Topic: [pyboard clone] SSD1306 - TypeError: object with buffer protocol required
Replies: 2
Views: 115

Re: [pyboard clone] SSD1306 - TypeError: object with buffer protocol required

>>> sys.version '3.4.0' This is the Python version, could you please also let us know the MicroPython version? sys.implementation same here. did you fix this problem? Could you check the same please? If you're using the latest version of ssd1306.py, you'll need to be running MicroPython v1.11. http...
by jimmo
Sat Jun 15, 2019 11:35 am
Forum: General Discussion and Questions
Topic: NRF24L01+ - stm32duino (blue pill) sender to micropython (ESP32) receiver not working
Replies: 5
Views: 165

Re: NRF24L01+ - stm32duino (blue pill) sender to micropython (ESP32) receiver not working

One observation from looking at the Arduino library you're using -- not all NRF24L01 support 250kbps, so although both your Python code and Arduino sketch both explictly set it to 250kbps, in Python setting the data rate will do nothing, leaving it on the default 2Mbps. Whereas the Arduino library a...
by jimmo
Sat Jun 15, 2019 11:21 am
Forum: Programs, Libraries and Tools
Topic: Call method and passed as a parameter
Replies: 5
Views: 78

Re: Call method and passed as a parameter

Hi, Can you post a more complete example of the code (ideally the whole file). I'm unsure where you're putting this line i2c = I2C(-1, scl=Pin(self.clock), sda=Pin(self.sda), freq=400000) The general convention for drivers is to have the constructor take an instance of I2C (or SPI, etc), rather than...