Search found 8 matches

by martynwheeler
Sun Jan 31, 2021 10:56 am
Forum: Programs, Libraries and Tools
Topic: Pure Micropython LoRa library
Replies: 4
Views: 474

Re: Pure Micropython LoRa library

Thanks for that. think that uCTRL was asking what the value settings for the parameters correspended to, ie how to set a particular value for coding rate, spreading factor etc. This is a bit more involved, I need to look at the bits in the relevant registers and how they are set. I will look into it...
by martynwheeler
Sun Jan 31, 2021 10:18 am
Forum: Programs, Libraries and Tools
Topic: Pure Micropython LoRa library
Replies: 4
Views: 474

Re: Pure Micropython LoRa library

Thanks for the reply. I will look into that for the future, these are common settings. Looks like the adafruit library allows fine tuning of these parameters. I will dive into the docs and take a look.
by martynwheeler
Sat Jan 30, 2021 5:18 pm
Forum: Programs, Libraries and Tools
Topic: Enum in micropython - alternative?
Replies: 5
Views: 491

Re: Enum in micropython - alternative?

Hi,

Thanks for the reply. It seems that enum was not needed and i could just access values from the tuple.

Thanks again
by martynwheeler
Sat Jan 30, 2021 1:47 pm
Forum: Programs, Libraries and Tools
Topic: Pure Micropython LoRa library
Replies: 4
Views: 474

Pure Micropython LoRa library

Hi, In case anyone is interested, I have ported a python library to micropython to utilise LoRa communication from a microcontroller using the RFM95 module. https://github.com/martynwheeler/u-lora I have tested it on a Raspberry Pi Pico so far and it is all working. The library is different from the...
by martynwheeler
Sat Jan 30, 2021 10:09 am
Forum: Programs, Libraries and Tools
Topic: Enum in micropython - alternative?
Replies: 5
Views: 491

Re: Enum in micropython - alternative?

Hi, It is used a little later on to access values from the tuple by # set modem config (Bw125Cr45Sf128) self._spi_write(REG_1D_MODEM_CONFIG1, self._modem_config.value[0]) self._spi_write(REG_1E_MODEM_CONFIG2, self._modem_config.value[1]) self._spi_write(REG_26_MODEM_CONFIG3, self._modem_config.value...
by martynwheeler
Fri Jan 29, 2021 10:41 pm
Forum: Programs, Libraries and Tools
Topic: Enum in micropython - alternative?
Replies: 5
Views: 491

Enum in micropython - alternative?

Hi, Is there a way to handle enum classes in micropython? I am porting a library which has an enum class. class ModemConfig(Enum): Bw125Cr45Sf128 = (0x72, 0x74, 0x04) Bw500Cr45Sf128 = (0x92, 0x74, 0x04) Bw31_25Cr48Sf512 = (0x48, 0x94, 0x04) Bw125Cr48Sf4096 = (0x78, 0xc4, 0x0c) I guess I could replac...
by martynwheeler
Fri Jan 29, 2021 7:39 am
Forum: Programs, Libraries and Tools
Topic: Using SPI to send list
Replies: 3
Views: 274

Re: Using SPI to send list

Thanks, I will give it a go later.
by martynwheeler
Thu Jan 28, 2021 10:44 pm
Forum: Programs, Libraries and Tools
Topic: Using SPI to send list
Replies: 3
Views: 274

Using SPI to send list

Hi, I am trying to port a function from python into upython. The function uses the spidev library in python which does not exist in upython. here is the python function: def _spi_write(self, register, payload): if type(payload) == int: payload = [payload] elif type(payload) == bytes: payload = [p fo...