Look at this existing tutorial https://lerryws.xyz/posts/PyQGIS-in-Jupyter-Notebook
| /* HC-SR04 Sensor | |
| https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696 | |
| This sketch reads a HC-SR04 ultrasonic rangefinder and returns the | |
| distance to the closest object in range. To do this, it sends a pulse | |
| to the sensor to initiate a reading, then listens for a pulse | |
| to return. The length of the returning pulse is proportional to | |
| the distance of the object from the sensor. | |
| The circuit: |
| import fiona | |
| import click | |
| from rasterio import features, Affine | |
| def makeAffine(bounds, width): | |
| xD = bounds[2] - bounds[0] | |
| yD = bounds[3] - bounds[1] | |
| cS = xD / float(width - 2) | |
| height = int(yD / cS) + 1 |
Displays with 4.3" and 16:9 ratio like the one below are available from Chinese outlets for less than $10. Resolution is 480x272 but it's not clear if that's the raw resolution or actual RGB pixels. Power supply is 12-24V (actually 9-34V). Two video inputs are provided, one has priority. If used with a rear-view camera the lower-priority input can be used as a status display. If no video input is provided the display is in standby.
My monitor has a native resolution of 272 lines. I'm not sure to which TV standard that corresponds (maybe PAL?) but with the help of an SSH session the command tvservice -c "NTSC 4:3 P" results in a stable image. I'd like switch to TV-out mode; for this purpose the command shows the corresponing sdtv_mode value for /boot/config.txt. I had to adjust the overscan settings to use the full
