Skip to content

Commit e8ee315

Browse files
committed
Next
1 parent 0b2a21b commit e8ee315

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Diff for: content/2018/04/2018-04-06-piwars-fixing-sensors.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: PiWars 2018 Robot - getting the camera and sensors working again
3+
date: 2018-04-06
4+
tags: [robot building, piwars, opencv, electronics, power, raspberry pi robotics project, raspberry pi opencv project, python, raspberry pi camera]
5+
---
6+
After changes to the robot hardware, a new software SD card image and lots of work on the robot, I needed to get the camera going again. It seems that the parts I'd not been paying attention to were now broken.
7+
8+
## Getting the camera working
9+
10+
* I need the picamera python library:
11+
12+
```bash
13+
pip install picamera
14+
```
15+
16+
* Now try my `skittletrack` code - which has had a tiny bit of python 3 adapting.
17+
* No module gpiozero - do we really use it? No - removed.
18+
* We then need the camera enabled:
19+
20+
```log
21+
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
22+
```
23+
24+
* Tried enabling it in raspi config. Nope. AH - it's not plugged in. Shutdown and fix that.
25+
26+
## After refitting and rebooting
27+
28+
Try again - get it running.
29+
30+
Yes - it works - and tracks!
31+
32+
We have working tracking - for random objects. Need to find HSL values for stuff, but this is a good start.
33+
34+
## Single distance sensor
35+
36+
It looks like this can be done with rpi gpio (as in Piconzero datasheet) or perhaps with gpiozero.
37+
38+
It was a dependency of the `skittlebot` class in the code.
39+
40+
## Multiple sensors
41+
42+
This is going to get interesting. I had a chat with @4tronix on twitter and asked for some ideas for using multiple distance sensors with the PiConZero.
43+
The PiConZero itself wouldn't be able to, but additional GPIO boards could. So the options are:
44+
45+
* creating a shim to attach to sensors.
46+
* Finding an IO extender/interceptor board.

0 commit comments

Comments
 (0)