Table of Contents

initialise Expansion Board

Description

The block initializes the Expansion Board of Quarky for use. Without initialization, the board will not respond to any other blocks.

Example

In this example, we will demonstrate how to control the door of the IoT House.

In this example, we will demonstrate how to control the door of the IoT House.

Circuit

Connect the servo motor to the Quarky Expansion Board servo pin 5.

Door Control

The door of the IoT House is controlled with a servo motor. You need to make the servo motor set to 0 angles before assembling the door. You can do it with the following script.

Door Control Script

The following script makes the door closed by default and opens it for 1 second when the space key is pressed.

Output

Press the space key to make the door open.

Read More
In this example, we are going to learn how to program Quarky to detect the temperature (using DHT Sensor) and make the fan ON and OFF accordingly.

In this example, we are going to learn how to program Quarky to detect the temperature (using DHT Sensor) and make the fan ON and OFF accordingly.

DHT Sensor Connection to Quarky

  1. DHT sensors have 3 pins: GND, VCC, and Signal. You have to connect the following 3 pins to the Quarky Expansion Board:
    1. GND to Ground Pin of Quarky Expansion Board
    2. VCC to 3.3V or VCC Pin of Quarky Expansion Board
    3. Signal to the D3 (Digital Pin) of the Quarky Expansion Board
  2. Fan Motor: Connect the Fan Motor to Motor 1 (M1) of the Quarky Expansion Board.

Getting Sensor Reading

The following script displays the real-time sensor reading.

Download Code: https://pictoblox.page.link/eHAFsRRW6CoEifmn9

 

Connect Quarky and you will start getting the readings.

Controlling Fan

The following makes the fan motor turn ON at 50% speed for 1 second, then turn OFF for 1 second, then turn ON at 100% speed for 1 second and finally turn OFF for 1 second. This will repeat in a loop.

Download Code: https://pictoblox.page.link/vWTfiWkgi2w8BhsNA

Automatic Fan Control

The following scripts, make the fan turn ON whenever the temperature is greater than 26 degrees.

Uploading Code

You can also make the automatic lighting work independent of PictoBlox using the Upload Mode. For that switch to upload mode and replace the when green flag clicked block with when Quarky starts up block.

Click on the Upload Code button.

Read More
All articles loaded
No more articles to load