#Help with vfo code and display

1 messages · Page 1 of 1 (latest)

rugged spade
#

Traceback (most recent call last):
File "code.py", line 4, in <module>
ImportError: no module named 'gpio'

#

we managed to regenerate code using gpio and not digital pins

#

but the import gpio what should it be

#

this one has the gp pins set correctly

#

Traceback (most recent call last):
File "code.py", line 4, in <module>
ImportError: no module named 'gpio'

rugged spade
#

Traceback (most recent call last):
File "code.py", line 12, in <module>
ValueError: GP10 in use

rugged spade
#

this looks to be a busio lib issue

unreal abyss
#

What software and hardware are you using? is this Circuitpython or Micropython?

#

It looks like circuitpython libraries, but you're crossing some Linux python into your code with the gpio.

#

I also see an interrupt service routine, which seems odd considering circuitpython does not support interrupts.

rugged spade
#

CircutPy and a raspi pico

#

CTRL-D to reloadis on the screen

#

but I dont get the gp10 issue

#

I can post the latest I was testing to try and figure out the issue

#

as I was going through trying to find out the pin but I think its a lib issue

#

it must have to have a export spi in it somewhere

#

gotten further

#

Traceback (most recent call last):
File "code.py", line 25, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

unreal abyss
#

Pi Pico does not have a board.I2C() you'll need to define it with busio.I2C().

rugged spade
#

#USE for I2C
SCL = board.GP5
SDA = board.GP4

Setup I2C for Si5351

i2c = busio.I2C(SCL, SDA)
si5351 = adafruit_si5351.SI5351(i2c)

#

Traceback (most recent call last):
File "code.py", line 29, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

#

I figure its complaining as I dont have the si5351 connected at the min

unreal abyss
#

Without a device or pullup resistors connected, the I2C bus won't initialize.

rugged spade
#

ok

#

well as the disple covers the pins its hard connect

#

I will have to wit till the new screen gets here

#

displayio.release_displays() fixed the gp10 issue

#

so we are closer

#

got further

#

took screen off and put the si5351

#

NameError: name 'gpio' is not defined

#

so what is used insted of gpio

#

enc_switch = gpio.InputPin(ENC_SWITCH)
enc_a = gpio.InputPin(ENC_A)
enc_b = gpio.InputPin(ENC_B)
rit_enc_a = gpio.InputPin(RIT_ENC_A)
rit_enc_b = gpio.InputPin(RIT_ENC_B)
rit_enc_btn = gpio.InputPin(RIT_ENC_BTN)
step_switch = gpio.InputPin(STEP_SWITCH)
memory_save_btn = gpio.InputPin(MEMORY_SAVE_BTN)
memory_recall_btn = gpio.InputPin(MEMORY_RECALL_BTN)

unreal abyss
rugged spade
#

there are no D pins on this board its all GP

#

aka gpio

unreal abyss
#

Wherever the guides use Dxx, replace with GPxx. It's a quirk of the RP2040.

rugged spade
#

ok now this is confusing

rugged spade
#

man rotoryio wont work with the pico this sucks

#

ok got that but now next issue

#

TypeError: data_pin must be of type Pin, not NoneType

#

audio_in = audiobusio.PDMIn(MIC_PIN, None)

#

working to get audio in and out over usb

#

Traceback (most recent call last):
File "code.py", line 248, in <module>
File "code.py", line 238, in main
NameError: local variable referenced before assignment

#

getting closer but now lost in this issue

#

diabled the usb sound for now

rugged spade
#

but not getting further

#

in a loop

#

might be its not seeing display as its unplugged as I needed to open the pins

rugged spade
#

ok I am closer to have things working with diff display but having issues

#

Traceback (most recent call last):
File "code.py", line 26, in <module>
AttributeError: .show(x) removed. Use .root_group = x

#

using the st7735 spi display

rugged spade
#

Traceback (most recent call last):
File "code.py", line 37, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

#

but they are wird up

rugged spade
#

now I have a loof error

#

Traceback (most recent call last):
File "code.py", line 247, in <module>
File "code.py", line 237, in main
NameError: local variable referenced before assignment

rugged spade
#

ok so we started fresh today and its seems to work but nothing on display

#

and no erros on the serial console

#

Code stopped by auto-reload. Reloading soon.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

#

no errors but no output

#

checking screen wireup now

rugged spade
#

got it working. but now to make it look better

#

it was the pin out 2 pins in the wrong place

rugged spade
#

ok we have working code but having 2 issues rit is not applying to the freq on the last 2 numbers and the steps are not working

rugged spade
rugged spade
#

morning

#

so we managed to fix the rit to work correctly but now having issues with the freq encoder

#

Traceback (most recent call last):
File "code.py", line 205, in <module>
File "code.py", line 185, in handle_freq_encoder
File "code.py", line 163, in set_frequency
AttributeError: 'SI5351' object has no attribute 'set_freq_manual'

rugged spade
#

ok got it

#

man what a pain

#

and have a simulated s meter for now

#

but I have to find how to store and recall current freq and to store and recall memories either to nvm or epprom

#

it shows mem slot 1 but I need it to display the freq in that slot or say empty.

#

and how to add some static memories.

rugged spade
#

so I have 99% of code working . but how to store the current freq and recall if power off and back on

#

current code. memory function not working.

rugged spade
#

documented code.

#

need help also mapping the black screen is no use in so long time out

#

the smeter function also might need work

rugged spade
rugged spade
#

ok adding in a nvm storage setting and recall for power on and off but now just a white screen