The line follower algorithm is ported to Scratch

We have now got Scratch to work with RoboHAT.

We needed to first install Scratch GPIO Plus. Then we created the Scratch program, see below.

capture

Please note that AddOn should be set to “robohat”, all lower case.

capture

Here is the algorithm that used the left and right line sensors to change the motor settings and steer the robot.

algorithm2

Lastly here is the configuration of the pins for RoboHAT in /opt/scratchgpio7/scratchgpio_handler7.py

capturescratch

and

capture

Here also are the Scratch files for the PiRoCon controller with the Initio robot that we will modify to use with the RoboHAT: https://github.com/4tronix/PiRoCon

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s