Skip to main content
STEAM.HK
Sugar PIR Sensor Module

KittenBot

Sugar PIR Sensor Module

Price on request
規格預設規格

Sugar PIR Sensor Module

Price on request

Overview

This is a PIR sensor module in the Sugar sensor series. The pin holes on the back allow compatibility with plastic building bricks.

Product Specifications

  • Dimensions: 24 x 24 x 19 mm

  • Weight: 5.6g

  • Type: Digital

  • Sensing Radius: 5m

Wiring

Use a 3Pin cable to connect the module to Robotbit Edu.

Programming Tutorial

MakeCode Programming Tutorial

Import Sugar Extension

Search for sugar in the search bar (Kittenbot products has been verified by Microsoft)

Importing Extensions Tutorial

Extension URL

Sugar extension: https://github.com/KittenBot/pxt-sugar

Sample Program

Kittenblock Programming Tutorial

Micropython Programming Tutorial

PIR(pin)
value()
  • value(): Returns sensor status

Sample Program

from future import *
from sugar import *

pir = PIR('P1')

neopix=NeoPixel("P7",3)

while True:
    if pir.value():
        neopix.setColorAll((103, 0, 0))
    else:
        neopix.setColorAll((0,0,0))

Specifications

Brand
KittenBot
Category
功能模組

More from this series