Hello
I am making mini desk for computer. When I run the program, the data sent from Pico is not arriving at the computer.
main.py - raspbi pi pico code
Compcode.py - computer code
Please help me ๐
#๐ Problem with prototype
60 messages ยท Page 1 of 1 (latest)
@split shell
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
Click here to see this code in our pastebin.
idk hardware stuff but this looks interesting
Try printing what comes in the ser
line = ser.readline().decode('utf-8', errors='ignore').strip()
print(line)
move those code at line 56 and 57 to before line 55. Make sure its indented the same as the if condition
Is that correct?
you messed up
Yeah i know๐
Replace your while True loop with this:
while True:
line = ser.readline().decode('utf-8').strip()
print(line)
if ser.in_waiting > 0:
if line.startswith("LAUNCH:"):
handle_launch(line.split(":")[1])
elif line.startswith("VOLUME:"):
value = int(line.split(":")[1])
volume = int((value / 65535) * 100)
print(f"Volume: {volume}%")
it looks like there's nothing coming through on the serial port
Is your computer Windows?
Yeah
Do you have Putty installed?
So the problem is in this Pico file.
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
idk about the pico file. All of that machine library is foreign to me.
So you have no experience with Pico?
What library did you install? machine?
No I have no experience. I mentioned it earlier #1402607253605056584 message
Try opening Putty and connect on Serial COM Port 6 with speed band 9600
If putty also shows no data, then its very likely the pico file is problematic
yea
So you can't fix Pico's code, right?
In the pico code, add print statements in places where you see uart.write()
Then test run and check your putty
Replace or add?
add
Try your main.py script next
Seems like print works, than uart.write()
interesting
When I press the button, the Apps turn on but the volume up and down buttons don't work.
How do you access the files stored on Pico? ssh?
Can you run commands on your Pico?
With thonny
I dont really know
Can you show me how you access files stored on Pico?
I see. That's very interesting. Well you can see that there are files on the left.
But yeah still no clue about the audio output out of the pico board
ssd1306.py is the screen software
I think this is the fault of the computer code because we get the sound centeredness from the Pico but the sound is not being transmitted to the computer.
Sorry I googled and have no idea. Where'd you learn how to do this?
from chatgpt๐คฃ
i have raspbi pi 5 and i dont know what to do with that
i will ask someone else
thank you for help
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.