Sei sulla pagina 1di 29

Internet of Things with ObjectBlocks

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

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 This returns the


program starts milliseconds since the
program starts

Get the microseconds since This returns the


program starts microseconds since the
program starts
Sensors
Block Description What it does

Read water level sensor This returns the reading


from analog pin from water level sensor
from analog pin.
Return: 0 - 1023

Read from rain sensor from This returns the reading


digital pin from rain sensor from digital
pin.
Return: true / false
Sensors
Block Description What it does

Read from soil moisture This returns the reading


sensor from analog pin from soil moisture sensor
from analog pin
Return: 0 - 1023

Read from light sensor from This returns the reading


analog pin 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 This returns if light sensor


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

Read temperature from This return the temperature


DHT11 sensor at digital pin. in celsius.
Returns: Temperature in
celsius.
Sensors
Block Description What it does

Read humidity from DHT11 This returns humidity from


at digital pin. DHT11 at the digital pin.
Returns: Humidity in
percentage

Read water temperature This return the water


from DS18820 (DFRobot) at temperature from DS18820
digital pin. (DFRobot) in celsius.
Returns: Temperature in
celsius.
Sensors
Block Description What it does

Read the button status from This returns button status at


digital pin. the digital pin.
Returns: true if pressed /
false if not

Read value from This return the value from


potentiometer from analog potentiometer from analog
pin. pin.
Returns: 0 - 1023
Sensors
Block Description What it does

Read value from line This returns if line follower


follower at digital pin at digital pin detects white /
black
Returns: true / false

Read PIR motion sensor This returns if motion is


from digital pin if motion is detected by PIR motion
detected. 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


(MRFC522) scanned RFID card / key
Returns: unique ID of
scanned RFID card / key

Read value from vibration This returns if vibration is


sensor at digital pin 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 This returns if any obstacle


at digital pin is detected by obstacle
sensor at digital pin.
Returns: true / false

Read from hall effect sensor This returns if magnetic field


(magnetic field) at digital pin is detected by hall effect
sensor at digital pin.
Returns: true / false
Sensors
Block Description What it does

Read the distance from This returns the distance


ultrasonic sensor at digital between sensor and
pins obstacle at digital pin.
Returns: distance in cm (2 -
400 cm)
Display
Block Description What it does

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


off at digital pin.

Set the intensity of LED at This sets the intensity of


digital pin LED at digital pin.
Display
Block Description What it does

Set the number in This will set the number to


7-segment display display in 7-segment display
(TM1650)

Clear the screen in This clears the screen in


7-segment display 7-segment display
(TM1650) (TM1650)
Display
Block Description What it does

Show the content in 1602 This shows the inputted


(I2C) display content in 1602 (I2C)
display.

Set up the cursor in 1602 This sets up the cursor in


(I2C) display 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) This clears the 1602 LCD
display (I2C) display.
Sound
Block Description What it does

Set the tone of buzzer at This sets the tone of buzzer


digital pin with specified at digital pin with specified
frequency frequency

Stop the tone of buzzer at This stops the tone of


digital pin buzzer at digital pin
Sound
Block Description What it does

Set the tone of buzzer at This sets the tone of buzzer


digital pin with specified at digital pin with specified
note and octive note and octive

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


buzzer
Action
Block Description What it does

Turn the motor clockwise This controls via motor


with motor driver driver connected to digital
pin and turns the motor
clockwise.

Move the servo to the This moves the servo to


specified degree specified degree
Degree range: 0 - 180
Process
Block Description What it does

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

Trigger the commands When the digital signal


when the input digital signal changes / changes from
changes high to low / changes from
low to high, this triggers the
commands within.
Process
Block Description What it does

Trigger the commands When analog signal


when the input analog changes from high to low
signal changes (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 This sets up the low-pass


pushbuttons. filter for filtering out high
frequency due to
pushbutton state changes

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


filter the frequency above the specified
frequency.
Process
Block Description What it does

Toggle between 2 sets of This will alternatively


commands execute the set of
commands when called.
Data
Block Description What it does

Tells if the specified channel This returns if the specified


has any update channel has any update
Returns: true / false

Read the number from the This returns the number


specified channel 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 This returns the message


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

Send the number to the This sends the number to


specified channel specified channel
Data
Block Description What it does

Send the message to the This sends the message to


specified channel specified channel

Send maximum 3 numbers This sends maximum 3


to Sigfox numbers to Sigfox
Webhooks
Block Description What it does

Trigger IFTTT event with This triggers IFTTT events


specified event name with specified event name
(defined in IFTTT
Webhooks service)

Trigger IFTTT event with This triggers IFTTT events


specified event name and with specified event name
value (up to 3 values can be and value (defined in IFTTT
sent) Webhooks service)

Potrebbero piacerti anche