0% found this document useful (0 votes)
222 views12 pages

Sensing Blocks and Examples in PictoBlox

Uploaded by

SIMRANJEET KAUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
222 views12 pages

Sensing Blocks and Examples in PictoBlox

Uploaded by

SIMRANJEET KAUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

PICTOBLOX EXTENSION

Sensing

Extension Description
Sensing blocks are associate with sprites and stage detecting conditions.

Available in: Block Coding, Python Coding


Mode: Stage Mode
WiFi Required: No
Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino
Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA,
None
Compatible Hardware in Python: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano,
ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
Object Declaration in Python: sprite = Sprite("Sprite-Name")
Extension Catergory: Default

Introduction

Sensing is one of the ten categories of default Scratch blocks. They are color-coded cyan and are used
to detect different factors of a project.

Read More
PictoBlox Blocks

The block checks if its sprite is touching the mouse-pointer, edge, or another sprite. If the sprite is
touching the selected object, the block returns true; if it is not, it returns false.

The block checks whether its sprite is touching a specified color. If it is, the block returns “true”.

The block checks whether a color on its sprite is touching another color. If it is, the block returns “true”.

The block reports the Euclidean distance, in pixels, between it and the mouse-pointer or a specified
sprite’s costume center.

The block will make an input box (with the specified text above it) show at the bottom of the screen.
Scratchers can input text into it and submit it, and the input is stored then in the Answer block. The
Answer block automatic updates to the most recent input.

The block holds the most recent text imputed with the Ask () and Wait block. When nothing has been
inputted yet, the value will hold nothing.

The block checks if the specified key is pressed. If the key is being pressed, the block returns “true”; if it
is not, it returns “false”.

The block checks if the computer mouse’s primary button is activated (being clicked).

9
The block holds (reports) the mouse-pointer’s current Mouse X.

10

The block holds the mouse-pointer’s current Mouse Y.

11

The block reports how loud the noise is that a microphone receives, on a scale of 0 to 100. To use this
block, a microphone must be used, and so a message will appear on the screen, asking for permission
to use the microphone. If you deny it, the block will report a loudness of 0 or -1.

12

The block starts at 0 when Scratch is launched and increases gradually; every second it will have
increased by 1.

13

The block sets the timer’s value back to 0.0. When this block is present, the project typically utilizes the
Timer output block; usually the timer must be reset at the beginning of a project for the Timer block to
hold the right value.

14

The block will report a specified value of the specified sprite or the Stage.

15

It reports either the current local year, month, date, day of the week, hour, minutes, or seconds,
depending on the argument. The block gets the data based on the user’s computer’s clock and set in 24-
hour clock.

16

It reports the number of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC).

Block Coding Examples


1
Beetle Movement
The example demonstrates how to use keys sensing to
control the movement of the sprite.

2 Covid Experiment – Velocity


In this example, we simulate the covid experiment using the
physics simulation.

3 Get Me the Apple Game


This example demonstrates the use of Physics simulation in a
game where Tobi has to go to the apple by jumping on the
slabs.

4
Mouse Tracker
The example demonstrates how to implement mouse
tracking.

5 Reciting Table
The example demonstrates how to use a repeat block to
recite a table in PictoBlox.

6 Shooting Bullets with Physics


In this example, we are making a rocket shoot bullets to the
mouse pointer when the space key is pressed.

7
Stamping Tobi
The example demonstrates how to use stamping and the
mouse location sensing in Block coding.

Python Functions

1
istouching()
The function checks if its sprite is touching the mouse-pointer, edge, or another sprite. If the sprite is
touching the selected object, the block returns true; if it is not, it returns false.
Syntax: istouching(object_name = “_edge_”)

2
distance()
The function reports the Euclidean distance, in pixels, between it and the mouse-pointer or a specified
sprite’s costume center.
Syntax: distance(object_name = “_edge_”)

3
input()
The function will make an input box (with the specified text above it) show at the bottom of the screen.
Users can input text into it and submit it, and the input is stored then in the Answer. The Answer
automatic updates to the most recent input.
Syntax: input(question = “What is your name”)

4
answer()
The function returns the most recent text imputed with the input() function. When nothing has been
inputted yet, the value will hold nothing.
Syntax: answer()
5
iskeypressed()
The function checks if the specified key is pressed. If the key is being pressed, the block returns “true”; if
it is not, it returns “false”.
Syntax: iskeypressed(key = “space”)

6
mousex()
The function reports the mouse pointer’s current X position on the stage.
Syntax: mousex()

7
mousey()
The function reports the mouse pointer’s current y position on the stage.
Syntax: mousey()

8
loudness()
The function reports how loud the noise that a microphone receives, on a scale of 0 to 100.
Syntax: loudness()

9
timer()
The function reports the time lapsed since the PictoBlox is launched and increases gradually; every
second it will have increased by 1.
Syntax: timer()

10
resettimer()
The function sets the timer’s value back to 0.
Syntax: resettimer()

11
dayssince2000()
The function reports the number of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC).
Syntax: dayssince2000()

Python Coding Examples

1
Ball Movement – Python
The example demonstrates how to add movement to a sprite.

2 Beetle Movement – Python


The example demonstrates using key sensing to control the
sprite's movement in Python.

3 LED Control with Keys – Python


The example demonstrates how to control the glowing LED
using the keyboard keys in the Python Coding Environment.

4
Mouse Tracker – Python
The example demonstrates how to implement mouse
tracking in Python.

5 Mouse Tracking and Stamping – Python


The example demonstrates how to make the sprite track and
stamp its image on the mouse when the space key is pressed
in Python.

6 Reciting Table – Python


The example demonstrates how to use a repeat block to
recite a table in PictoBlox.

7
Sprite Direction – Python
The example demonstrates the sprite direction in Python.

8 Wirelessly Controlled Robot – Python


The example demonstrates how to control the motion of the
robot using keyboard keys in the Python Coding Environment.

Company
About Us
Blog
Partners and Distributors
Terms and Conditions
Privacy Policy
Careers

Community
Codeavour - AI Competition
Community Projects
Projects by STEMpedia
Example Projects
International Python Bootcamp
International Junior Blocks Bootcamp
International 3D and XR Studio Bootcamp
Products
Quarky - AI & Robotics Kit
Quarky Addon Kits
evive - STEM Kit
PictoBlox Software
Dabble App

School Programs
AI & Robotics Lab
Atal Tinkering Labs
STEM Innovation Lab
CBSE Aligned Coding & AI Lab
ICSE Aligned Robotics & AI Lab

Impact Programs
CSR & Government Impact Program

Learning Resources
Education Center
Courses & Teacher Resources

Product Documentation
Quarky Kits
evive Kits
PictoBlox Software
PictoBlox Extensions & Libraries
Dabble App
Arduino with PictoBlox

Get in Touch
Contact Us
Book a Demo
Request a Quote

Follow Us
PictoBlox - Block & Python Coding for Kids

Dabble App - One App. Infinite Control.

Copyright 2024 – Agilo Research Pvt. Ltd. All rights reserved – Terms & Condition | Privacy Policy

You might also like