Posts: 1
Joined: Mon Dec 25, 2017 10:28 pm

Ultrasonic Scratch2

Tue Dec 26, 2017 7:29 am

I use the ultrasonic sensor in scratch 1.4 (ultrasonic + trigger + trigger pin + echo + echo pin). On the other hand, I can not use this sensor in scratch 2. Do you have a solution?
Thank you

Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 278
Joined: Fri Jan 06, 2012 7:46 pm

Re: Ultrasonic Scratch2

Tue Jan 02, 2018 2:45 pm

A bit more info would be useful:

How are you connecting the sensor ?

What does your script look like, in both 1.4 and 2.0 ?

What is it, specifically, that doesn't work ?

Posts: 1291
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Ultrasonic Scratch2

Tue Jan 02, 2018 8:06 pm

since a short time scratchClient is supporting scratch2 in addition to scratch1.4. There is an adapter supporting the ultrasonic sensor.
See for a summary.

When connecting the ultrasonic HC-SR04, be sure to use level shifters for the output signal. The sensor is powered by 5V.

Hope this helps,

Return to “Scratch”