Search found 5 matches

by jp171
Fri Oct 22, 2021 9:23 am
Forum: Raspberry Pi microcontroller boards
Topic: ADC range = command
Replies: 8
Views: 2749

Re: ADC range = command

Thank you so much dhylands! That is working great! I had to do a little tweaking on the ranges but it is working finally.
by jp171
Thu Oct 21, 2021 6:01 pm
Forum: Raspberry Pi microcontroller boards
Topic: ADC range = command
Replies: 8
Views: 2749

Re: ADC range = command

I tried a different approach: while True: reading = adc_read.read_u16() def postions(position): if reading >= 39000 and reading <= 40100: position = "lower" elif reading >= 20800 and reading <= 21000: position = "right" elif reading >= 22000 and reading <=23200: position = "left" elif reading >= 300...
by jp171
Thu Oct 21, 2021 2:16 pm
Forum: Raspberry Pi microcontroller boards
Topic: ADC range = command
Replies: 8
Views: 2749

Re: ADC range = command

hippy wrote:
Mon Oct 18, 2021 4:14 pm
One way ...

Code: Select all

if adc >= 300 and adc <= 600:
    print("moving")
elif adc < 300:
    print("Less than 300")
else:
    print("Greater than 600")
This only works for 1 set of ranges if I try to use a second set of ranges I get syntax error.
by jp171
Wed Oct 20, 2021 5:32 pm
Forum: Raspberry Pi microcontroller boards
Topic: ADC range = command
Replies: 8
Views: 2749

Re: ADC range = command

hippy wrote:
Mon Oct 18, 2021 4:14 pm
One way ...

Code: Select all

if adc >= 300 and adc <= 600:
    print("moving")
elif adc < 300:
    print("Less than 300")
else:
    print("Greater than 600")
Thank you!
by jp171
Mon Oct 18, 2021 2:12 pm
Forum: Raspberry Pi microcontroller boards
Topic: ADC range = command
Replies: 8
Views: 2749

ADC range = command

I'm pretty new to programming so this may be simple but I cant figure it out yet. I'm attempting to make small ranges of adc signal (from one input) do different functions. I know the ranges and what I want each to trigger but I'm not sure how I make the pico do them. ie. if adc=(300-600): print("mo...