Sunteți pe pagina 1din 29
Internet of Things with ObjectBlocks Block Reference

Internet of Things with ObjectBlocks

Internet of Things with ObjectBlocks Block Reference

Block Reference

Use of this Reference

This serves as a guide for how each block is to be used during programming.

Note that not all blocks will be explained - only those specific to ObjectBlocks will be explained in this guide (e.g. if-do block is not, while read water level sensor pin block is)

Use of this Reference

Each page will be accompanied with a title of the corresponding category (e.g. Math, Time, Sensors etc), and the details of blocks will be discussed in the content of the page.

Math

Block

Description

What it does

Integer This is a number of an Integer type (i.e. no decimal) e.g. 12

Integer

This is a number of an Integer type (i.e. no decimal) e.g. 12

Float This is a number of a Float type (i.e. with decimal). e.g. 12.1, 13.0

Float

This is a number of a Float type (i.e. with decimal). e.g. 12.1, 13.0

Time

Block

Description

What it does

Get the milliseconds since program starts This returns the milliseconds since the program starts

Get the milliseconds since program starts

This returns the milliseconds since the program starts

Get the microseconds since program starts This returns the microseconds since the program starts

Get the microseconds since program starts

This returns the microseconds since the program starts

Sensors

Block

Description

What it does

Read water level sensor from analog pin This returns the reading from water level sensor

Read water level sensor from analog pin

This returns the reading from water level sensor from analog pin. Return: 0 - 1023

Read from rain sensor from digital pin This returns the reading from rain sensor from

Read from rain sensor from digital pin

This returns the reading from rain sensor from digital pin. Return: true / false

Sensors

Block

Description

What it does

Read from soil moisture sensor from analog pin This returns the reading from soil moisture

Read from soil moisture sensor from analog pin

This returns the reading from soil moisture sensor from analog pin Return: 0 - 1023

Read from light sensor from analog pin This returns the reading from light sensor from

Read from light sensor from analog pin

This returns the reading from light sensor from analog pin (note: plug in A0 pin in light sensor) Return: 0 - 1023 (darker the larger)

Sensors

Block

Description

What it does

Read from light sensor from digital pin This returns if light sensor detects any light

Read from light sensor from digital pin

This returns if light sensor detects any light (note: plug in D0 pin in light sensor) Returns: true / false

Read temperature from DHT11 sensor at digital pin. This return the temperature in celsius. Returns:

Read temperature from DHT11 sensor at digital pin.

This return the temperature in celsius. Returns: Temperature in celsius.

Sensors

Block

Description

What it does

Read humidity from DHT11 at digital pin. This returns humidity from DHT11 at the digital

Read humidity from DHT11 at digital pin.

This returns humidity from DHT11 at the digital pin. Returns: Humidity in percentage

Read water temperature from DS18820 (DFRobot) at digital pin. This return the water temperature from

Read water temperature from DS18820 (DFRobot) at digital pin.

This return the water temperature from DS18820 (DFRobot) in celsius. Returns: Temperature in celsius.

Sensors

Block

Description

What it does

Read the button status from digital pin. This returns button status at the digital pin.

Read the button status from digital pin.

This returns button status at the digital pin. Returns: true if pressed / false if not

Read value from potentiometer from analog pin. This return the value from potentiometer from analog

Read value from potentiometer from analog pin.

This return the value from potentiometer from analog pin. Returns: 0 - 1023

Sensors

Block

Description

What it does

Read value from line follower at digital pin This returns if line follower at digital

Read value from line follower at digital pin

This returns if line follower at digital pin detects white / black Returns: true / false

Read PIR motion sensor from digital pin if motion is detected. This returns if motion

Read PIR motion sensor from digital pin if motion is detected.

This returns if motion is detected by PIR motion sensor at digital pin. Returns: true if motion detects / false if not

Sensors

Block

Description

What it does

Read from RFID This returns unique ID of scanned RFID card / key Returns: unique

Read from RFID

This returns unique ID of scanned RFID card / key Returns: unique ID of scanned RFID card / key

(MRFC522)

Read value from vibration sensor at digital pin This returns if vibration is detected by

Read value from vibration sensor at digital pin

This returns if vibration is detected by vibration sensor at digital pin. Returns: true if vibration detects / false if not

Sensors

Block

Description

What it does

Read from obstacle sensor at digital pin This returns if any obstacle is detected by

Read from obstacle sensor at digital pin

This returns if any obstacle is detected by obstacle sensor at digital pin. Returns: true / false

Read from hall effect sensor (magnetic field) at digital pin This returns if magnetic field

Read from hall effect sensor (magnetic field) at digital pin

This returns if magnetic field is detected by hall effect sensor at digital pin. Returns: true / false

Sensors

Block

Description

What it does

Sensors Block Description What it does Read the distance from ultrasonic sensor at digital pins This

Read the distance from ultrasonic sensor at digital pins

This returns the distance between sensor and obstacle at digital pin. Returns: distance in cm (2 - 400 cm)

Display

Block

Description

What it does

Set LED at digital pin to on / off This turns on / off the

Set LED at digital pin to on / off

This turns on / off the LED at digital pin.

Set the intensity of LED at digital pin This sets the intensity of LED at

Set the intensity of LED at digital pin

This sets the intensity of LED at digital pin.

Display

Block

Description

What it does

Set the number in 7-segment display This will set the number to display in 7-segment

Set the number in 7-segment display

This will set the number to display in 7-segment display

(TM1650)

Clear the screen in 7-segment display This clears the screen in 7-segment display

Clear the screen in 7-segment display

This clears the screen in 7-segment display

(TM1650)

(TM1650)

Display

Block

Description

What it does

Show the content in 1602 (I2C) display This shows the inputted content in 1602 (I2C)

Show the content in 1602 (I2C) display

This shows the inputted content in 1602 (I2C) display.

Set up the cursor in 1602 (I2C) display This sets up the cursor in 1602

Set up the cursor in 1602 (I2C) display

This sets up the cursor in 1602 (I2C) display. The inputted content will be displayed at the set cursor. Dimension: 16 x 2

Display

Block

Description

What it does

Clear the 1602 LCD (I2C) display This clears the 1602 LCD (I2C) display.

Clear the 1602 LCD (I2C) display

This clears the 1602 LCD (I2C) display.

Sound

Block

Description

What it does

Set the tone of buzzer at digital pin with specified frequency This sets the tone

Set the tone of buzzer at digital pin with specified frequency

This sets the tone of buzzer at digital pin with specified frequency

Stop the tone of buzzer at digital pin This stops the tone of buzzer at

Stop the tone of buzzer at digital pin

This stops the tone of buzzer at digital pin

Sound

Block

Description

What it does

Set the tone of buzzer at digital pin with specified note and octive This sets

Set the tone of buzzer at digital pin with specified note and octive

This sets the tone of buzzer at digital pin with specified note and octive

Turn on / off the buzzer This turns on / off the buzzer

Turn on / off the buzzer

This turns on / off the buzzer

Action

Block

Description

What it does

Turn the motor clockwise with motor driver This controls via motor driver connected to digital

Turn the motor clockwise with motor driver

This controls via motor driver connected to digital pin and turns the motor clockwise.

Move the servo to the specified degree This moves the servo to specified degree Degree

Move the servo to the specified degree

This moves the servo to specified degree Degree range: 0 - 180

Process

Block

Description

What it does

Map the value from a range to another range proportionally. This maps the input value

Map the value from a range to another range proportionally.

This maps the input value from a range to another range proportionally.

Trigger the commands when the input digital signal changes When the digital signal changes /

Trigger the commands when the input digital signal changes

When the digital signal changes / changes from high to low / changes from low to high, this triggers the commands within.

Process

Block

Block Description Trigger the commands when the input analog signal changes What it does When analog

Description

Trigger the commands when the input analog signal changes

What it does

When analog signal changes from high to low (and pass lower threshold) / when signal changes from low to high (and pass higher threshold) / when signal changes (and pass lower / higher threshold), the commands within will be executed.

Process

Block

Description

What it does

Debounce the signal for pushbuttons. This sets up the low-pass filter for filtering out high

Debounce the signal for pushbuttons.

This sets up the low-pass filter for filtering out high frequency due to pushbutton state changes

Set up the low-pass filter to filter the frequency This filters out the frequency above

Set up the low-pass filter to filter the frequency

This filters out the frequency above the specified frequency.

Process

Block

Description

What it does

Process Block Description What it does Toggle between 2 sets of commands This will alternatively execute

Toggle between 2 sets of commands

This will alternatively execute the set of commands when called.

Data

Block

Description

What it does

Tells if the specified channel has any update This returns if the specified channel has

Tells if the specified channel has any update

This returns if the specified channel has any update Returns: true / false

Read the number from the specified channel This returns the number from specified channel (usually

Read the number from the specified channel

This returns the number from specified channel (usually after checking if any update from channel) Returns: number from channel

Data

Block

Description

What it does

Read the message from the specified channel This returns the message from specified channel (usually

Read the message from the specified channel

This returns the message from specified channel (usually after checking if any update from channel) Returns: message from channel

Send the number to the specified channel This sends the number to specified channel

Send the number to the specified channel

This sends the number to specified channel

Data

Block

Description

What it does

Send the message to the specified channel This sends the message to specified channel

Send the message to the specified channel

This sends the message to specified channel

Send maximum 3 numbers to Sigfox This sends maximum 3 numbers to Sigfox

Send maximum 3 numbers to Sigfox

This sends maximum 3 numbers to Sigfox

Webhooks

Block

Description

What it does

Trigger IFTTT event with specified event name This triggers IFTTT events with specified event name

Trigger IFTTT event with specified event name

This triggers IFTTT events with specified event name (defined in IFTTT Webhooks service)

Trigger IFTTT event with specified event name and value (up to 3 values can be

Trigger IFTTT event with specified event name and value (up to 3 values can be sent)

This triggers IFTTT events with specified event name and value (defined in IFTTT Webhooks service)