Python Forum
Sonar Code in Thonny for Pi Pico
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sonar Code in Thonny for Pi Pico
#2
At the end of the ultra() function add:
return distance
When calling the function:
distance = ultra()
This will make the distance available as a global variable in the module.
iansmiler likes this post
Reply


Messages In This Thread
Sonar Code in Thonny for Pi Pico - by iansmiler - Nov-22-2023, 10:32 AM
RE: Sonar Code in Thonny for Pi Pico - by deanhystad - Nov-22-2023, 12:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  hardware timer raspberry pico trix 4 318 Jun-27-2024, 09:29 AM
Last Post: Larz60+
  raspberry pico second core ? trix 3 231 Jun-24-2024, 04:11 PM
Last Post: trix
  Minimal python install for thonny ide DanielRossinsky 0 1,586 Jun-11-2020, 02:31 PM
Last Post: DanielRossinsky
  Does "import xlrd" work in Thonny? cnutakor 3 3,165 Apr-30-2020, 12:41 AM
Last Post: Larz60+
  Values into system calls (RPi 4 Raspbian Buster Thonny) hitsware 1 2,401 Aug-27-2019, 07:29 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020