يحاول ذهب - حر

Sensor and motor control with the GPIO

December 2021

|

Linux Format

Les Pounder shows how we can take Scratch further with a community-developed tool that builds on our Scratch knowledge.

- Les Pounder

Sensor and motor control with the GPIO

YOU NEED

Pi model 3/4/400

The latest Pi OS HCSR04-P

Ultrasonic sensor

L9110S motor controller DC motor

Micro USB breakout PSU for motor

7x F2F wires

2x M2F wires

Internet

Get the code https:// github.com/ lesp/ S3GPIOLXF283/ archive/ refs/heads/ main.zip

Over the past few issues we’ve learnt how to create games, control electronics and create shapes by calculating angles, all with Scratch 3. As good as Scratch 3 is there’s only so much that we can do with the GPIO, and the GPIO is the best feature of the Raspberry Pi. So how can we take our Scratch GPIO projects further? Well, for that we need S3GPIO.

S3GPIO is short for Scratch 3 GPIO and it was created by Simon Walters, a Raspberry Pi community member who’s campaigned for children to learn coding and electronics with Scratch. Walters first foray into the GPIO for Scratch was ScratchGPIO, based upon Scratch 1.4. This version is still active – in fact we can find out more at http://simplesi.net.

In this tutorial we’ll install S3GPIO, learn how to use an ultrasonic sensor as a controller for a DC motor, effectively setting the speed based on our distance from the sensor.

Connecting the electronic components is relatively simple, but the amount of wires may seem confusing. We’ll break it down into sections.

المزيد من القصص من Linux Format

Linux Format

Linux Format

Create your first WebSocket service

Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.

time to read

9 mins

April 2023

Linux Format

Linux Format

Fantastic Mr Firefox

Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.

time to read

9 mins

April 2023

Linux Format

Linux Format

Set up your terminal and email like it's 1983

Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.

time to read

8 mins

April 2023

Linux Format

Linux Format

Universal layer text effects with GIMP

Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.

time to read

8 mins

April 2023

Linux Format

Linux Format

Jump to a federated social network

Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.

time to read

9 mins

April 2023

Linux Format

Linux Format

Free our SOFTWARE!

Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!

time to read

4 mins

April 2023

Linux Format

Linux Format

Master RPI.GPIO

Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -

time to read

5 mins

April 2023

Linux Format

Linux Format

Waveshare Zero to Pi3

Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.

time to read

2 mins

April 2023

Linux Format

Linux Format

The Best OPEN SOURCE Software Ever!

In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.

time to read

19 mins

April 2023

Linux Format

Linux Format

Linux-Mandrake 7

Simplicity and a wide range of applications make this a great distribution for all Linux users.

time to read

2 mins

April 2023

Translate

Share

-
+

Change font size