This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Combine various blocks to make a logical maze solving algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is one way to program a robot to follow a black line. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using the colour sensor, you can detect a range of colours and how much light is reflected from an object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The folowing gists may be useful, but feel free to just make things up yourself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start by building your robot. | |
The simplest robot is the Spike hub connected to two wheels and a caster | |
There are lots of ways to build a similar 2-wheeled bit, and the design shown here might not be the best for every task. | |
You may also need to adapt your code if you build a bot with larger motors or wheels. |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the libraries | |
from sense_hat import SenseHat | |
from time import sleep | |
# Set up the Sense HAT | |
sense = SenseHat() | |
sense.set_rotation(270, False) | |
# Set up the colour sensor | |
sense.color.gain = 60 # Set the sensitivity of the sensor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# m8tricks output file | |
from sense_hat import SenseHat | |
from time import sleep | |
sh = SenseHat() | |
sh.rotation = 270 | |
sh.clear(0,0,0) | |
g = (0,255,0) | |
y = (255,255,0) | |
b = (0,0,0) | |
p = (255,0,255) |
NewerOlder