SunFounder pico_4wd_car
After the code runs, if you push it to a cliff, it will be awakened urgently, then back up, and shake its
head to express dissatisfaction.
Note:
If
the
result
is
not
satisfactory,
please
modify
the
fourth
line
car.
GRAYSCALE_EDGE_REFERENCE = 1000
.
This is a threshold that tells the car if the grayscale sensor detected values are below 1000, then it
should be considered a cliff and can move backward.
This threshold can be obtained in the
Test the Grayscale Sensor Module
section, for example, in my
test, the detected cliff value is basically around 700, so here it is set to 1000, as long as it is lower
than 1000, it can be considered to detect a cliff.
4. To enable Pico-4wd to run this code on boot, you need to save
donot_push_me.py
to the Raspberry Pi Pico
as
main.py
, as follows.
• Stop the script from running and click
File
->
Save as
.
30
Chapter 1. Get Started
Содержание Pico-4wd car
Страница 1: ...SunFounder pico_4wd_car www sunfounder com Sep 21 2022 ...
Страница 2: ......
Страница 4: ...ii ...
Страница 7: ...SunFounder pico_4wd_car SunFounder Pico 4wd Car Code Or check out the code at CONTENTS 3 ...
Страница 8: ...SunFounder pico_4wd_car 4 CONTENTS ...
Страница 10: ...SunFounder pico_4wd_car 3 Next click Next and Install to finish installing Thonny 6 Chapter 1 Get Started ...
Страница 24: ...SunFounder pico_4wd_car 2 Run the test_grayscale py file in pico_4wd_car_main tests 20 Chapter 1 Get Started ...
Страница 37: ...SunFounder pico_4wd_car How it Work 1 6 6 Examples 33 ...
Страница 44: ...SunFounder pico_4wd_car How it works 40 Chapter 1 Get Started ...
Страница 56: ...SunFounder pico_4wd_car 52 Chapter 1 Get Started ...
Страница 66: ...SunFounder pico_4wd_car 62 Chapter 4 Thank You ...