Block and I/O pin availability will vary with board type for each sensor. Use care if accessing I/O pins connected to built-in accessory circuits on your board. Refer to your board's product guide for I/O pin assignment details.
Only for Propeller Activity Board WX board type.
These blocks are for Parallax's 2-Axis Joystick (#27800) [1] used only with the A/D converter built into the Propeller Activity Board (original or WX).
New to this sensor? Click here to see an example schematic and quick Blockly program [2] to help you get started.
The Joystick x-axis block returns the horizontal position of the joystick, which can range from 0 to 100.
Connect the Joystick's L/R (x-axis) pin to a numbered A/D socket on the Propeller Activity Board WX, and then set the A/D drop-down to that socket's number (0-3).
The Joystick y-axis block returns the vertical position of the joystick, which can range from 0 to 100.
Connect the Joystick's U/D (y-axis) pin to a numbered A/D socket on the Propeller Activity Board WX, and then set the A/D dropdown to that socket's number (0-3).
The Parallax 2-Axis Joystick can be used for a wide variety of projects like wheeled robots, video games, or anything requiring user input. The Propeller Activity Board's A/D converter reads the joystick's output on each axis.
Using the connections shown in the wiring diagram above, this program will show you Joystick Up/Down and Left/Right position values (0-99) in the Terminal.
For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types.
These blocks are specifically for the 4 x 4 Matrix Membrane Keypad (#27899) [3] sold by Parallax.
New to this sensor? Click here to see an example schematic and quick Blockly program [4] to help you get started.
The 4x4 Keypad Initialize block defines the connections between the Keypad's ribbon cable and the Propeller microcontroller's I/O pins. I/O pin availability will vary by board type.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget to use this block in your program, a triangle warning icon will appear on other 4 x 4 keypad blocks as a reminder.
With the keypad facing you, start matching from the leftmost pin to the rightmost pin. The four rightmost pins MUST be connected to pull-down resistors; use 1 k-ohm to 100 k-ohm resistors for this.
The 4x4 Keypad read block provides a number value for the key pressed.
This example is specifically for the 4 x 4 Matrix Membrane Keypad (#27899) [3] sold by Parallax.
Using the connections shown in the wiring diagram above, this program will show you the number of the key you are pressing on the keypad, in the Terminal, updating once per half-second.
The numbers you see should be very stable. If they fluctuate quickly, or if you notice numbers showing up that you did not press, double-check that you have 1 kOhm (or higher) resistors from pins P7-P4 going to ground and that they're firmly in the correct breadboard row and ground holes. See connection image, above.
Available for Propeller Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types. I/O pin range options will vary with board type.
These blocks use a BME680 Environmental Sensor Module (#28061) [5]
The Air Quality initialize block sets up the BME680 sensor. If you forget to use this block, other Air Quality sensor blocks will remind you with a triangle-shaped warning icon:
From the drop-down menus, select the Propeller I/O pin numbers that are connected to the sensor module's SCK, SDI, SDO, and CS pins.
The Air Quality read block instructs the BME680 sensor to take a set of measurements and store them. This block should be used immediately before using an Air Quality get value block.
The Air Quality get value retrieves the specified sensor reading from the last time the Air Quality read block was used.
The Air Quality heater is used to enable or disable the internal heating element inside the BME680 sensor.
Compatible only with Badge board types.
The Badge accelerometer get block returns acceleration and tilt on one of 3 axes (AX, Ay, or AZ) in centigravity units (cg) which is 100ths of 1 gravity (1 g).
The Badge accelerometer shaken block checks to see if the accelerometer was shaken within the last half second.
Block availability varies by Badge type.
Compatible only with the Hackable Electronic Badge board type
The Badge button touchpad block returns the state of the specified rocker or touchpad button - (1) pressed, (0) not pressed.
Compatible only with the Badge WX board type
The Badge button block returns the state of the specified rocker or touchpad button - (1) pressed, (0) not pressed.
Compatible only with the Badge WX board type
The Badge touch sensitivity block sets the sensitivity of the touchpads (A & B) on the badge.
Available for Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types. I/O pin range options will vary with board type.
These blocks use a ColorPal Color Sensor (#28380) [6]
New to this sensor? Click here to see an example schematic and quick Blockly program [7] to help you get started.
This block launches a processor automatically, one per block instance.
The ColorPal initialize block sets up the ColorPal sensor. If you forget to use this block, other LCD blocks will remind you with a triangle-shaped warning icon:
From the PIN dropdown, select the Propeller I/O pin number that is connected to the ColorPal module's signal pin.
If you use more than one ColorPal initialize block in a project, the other ColorPal blocks will provide a drop-down to select the Propeller I/O pin for your target ColorPal module.
The ColorPal raw colors block measures the amount of red, green, and blue it detects. Each of those three raw values is stored in the corresponding variable selected in each drop-down menu. The raw values can range from 0 to 4095. The raw values are not white-balanced, but when used correctly, they can be more accurate than the value provided by the ColorPal get color block.
The ColorPal get color block takes a measurement and provides a single, approximate white-balanced, 24-bit color value that is stored in the variable selected in the drop-down. That variable can then be used with other color value blocks [8].
For sensing color, the ColorPAL uses its LED to illuminate a sample, one color component at a time, along with a broad-spectrum light-to-voltage converter to measure the light reflected back. The amount of light reflected from the sample under illumination from each red, green, and blue LED can be used to determine the sample’s color.
If using a Propeller Activity Board, the ColorPal can be connected to either the breadboard or via a 3-wire extension cable to one of the servo headers P12-P17.
Using the connections shown in the wiring diagram above, this example will display the RGB values detected by the ColorPal in the Terminal. Try holding differently-colored objects up to the sensor to see their RGB values.
These blocks are for use with the Fingerprint Scanner (#29126) [9] and the Propeller Activity Board WX, Propeller FLiP or Other board types. Not available for Badge or Scribbler Robot board types.
New to this sensor? Click here to see an example schematic and quick Blockly program [10] to help you get started.
This block launches a processor automatically. Use only one instance of this block per project.
Use the Fingerprint scanner initialize block to specify which Propeller I/O pins are connected to your device. I/O pins available for this use will vary with board type.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget to use this block in your project, a triangle warning icon will appear on other Fingerprint scanner blocks as a reminder.
The Fingerprint scanner capture block lets you manage the fingerprint scans that are stored on the device. The action options from the drop-down menu are:
The Fingerprint scanner scan block can perform three different actions and provides a value based on the outcome of the action. (However, none of these actions capture and save a new scan onto the device.)
The Fingerprint Scanner can scan and store up to 1000 fingertip image captures. Your BlocklyProp project can compare a new scan to a specific capture by ID, or search all its captures for a match.
Using the connections shown in the wiring image above, this example uses the Terminal to prompt a user to scan and assign an ID to their fingerprint, and then check that their fingerprint matches the assigned ID.
For Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types.
These blocks are compatible with GPS modules delivering an NMEA 0183 serial data stream. This includes Parallax's SIM33EAU GPS Module (#28504) and PAM-7Q (Parallax #28509).
New to this sensor? Click here to see an example schematic and quick Blockly program [11] to help you get started.
This block launches a processor automatically. Use only one instance of this block per project.
The GPS Init block configures the communication from your GPS module to your Propeller microcontroller.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget to use the GPS init block first, other GPS blocks will show a triangle warning icon as a reminder:
* I/O pin numbers available in this dropdown will depend on your selected board type.
The GPS has satellite fix block lets you know if your GPS module is receiving a usable satellite signal. The block provides 1 if true, 0 if false.
The GPS latitude block provides the latitude in microdegrees (millionths of degrees). Latitudes north of the Earth's equator are positive values, and latitudes south of the Earth's equator are negative values.
The GPS longitude block provides the longitude in microdegrees (millionths of degrees). Longitudes east of the Prime Meridian to are positive values, and longitudes west of the Prime Meridian are negative values.
The GPS heading block provides heading—the direction of travel—in degrees clockwise from magnetic north. The GPS module must be moving faster than two miles per hour to provide a meaningful heading value.
The GPS altitude block provides altitude above sea level in centimeters.
The GPS speed block provides the speed that the GPS module is traveling, in the chosen unit of measurement. Choose mph (miles per hour) or knots (nautical miles per hour) from the drop-down menu. The GPS module must be moving faster than two miles per hour to provide a meaningful speed value.
The GPS satellites tracked block provides the number of satellites that the GPS module can see.
These blocks are compatible with GPS modules delivering an NMEA 0183 serial data stream. This includes the SIM33EAU GPS Module (Parallax #28504) and the PAM-7Q (Parallax #28509).
Schematic for Parallax's SIM33EAU GPS Module (#28504) and Propeller microcontroller for the example functions below. Wiring may be different for the PAM-7Q or other GPS modules, please see their product guides for specifics.
FLiP Wiring Alert! If using the Propeller FLiP module with a GPS module, use a 3-pin extension cable to provide some distance between the two modules to improve satellite reception and reduce interference.
The GPS Data Output Blockly example retrieves longitude, latitude, speed, heading, elevation, and number of satellites from the GPS module. The units are converted to decimal degrees and displayed in the Blockly terminal. The underlying GPS library is compatible with NEMA-formatted GPS strings.
This example features a large number of blocks. We recommend that you download the SVG file containing this pre-arranged program below, rather than recreate it block-by-block.
Your workspace should now contain the following program (note that these blocks are displayed in a different layout in this image):
These blocks may be used with the HMC5883L compass module (#29133, discontinued) [14] blocks and the Propeller Activity Board WX, Propeller FLiP module, and Other board types. Not available for Badge or Scribbler Robot board types.
The Compass initialize block sets up the communication between the Propeller chip and the compass module.
Set each drop-down to match the Propeller I/O pins connected to the HMC5883L compass module's SCL and SDA pins. (The drop-down options go to 27, but do not set higher than 17 with the Propeller Activity Board WX, as P18-P31 are already connected to other built-in circuits on this board.)
The Compass heading block stores the current unadjusted heading measured by the HMC5883L, in degrees as an integer, ranging from 0 to 359.
Compatible with the Propeller Activity Board WX, Propeller FLiP, or Other board types. Not available for Badge or Scribbler Robot board types.
SOLO ONLY! These blocks are only supported by BLOCKLYPROP SOLO [15]. No login required, save your files on your computer!
These blocks are for using the LIS3DH 3-Axis Accelerometer with ADC (#29020) [16]. The blocks support a 3-wire SPI interface as shown. You may also use the device's analog to digital converter to monitor the voltage on a circuit connected its AD1 pin or its AD2 or AD3 pads. Connect AD1 to reference voltages for calibration, explained in the blocks below.
An acceleration meter (accelerometer) senses the forces that acceleration and gravity exert on a small mass inside the sensor. Think about that feeling of being pressed into your seat back as your car speeds up rapidly. Now think about the feeling of how gravity pulls you to the ground. Those are examples of the forces that an accelerometer senses and reports. The LIS3DH is a 3-axis accelerometer module that can measure up to +/- 16g of acceleration in 3 axes up to 50 times per second.
The LIS3DH initialize block is required to set up the sensor connections. If you forget to use this block, you will see a triangle warning symbol on other LISD3DH blocks as a reminder.
The LIS3DH initialize block will show additional fields if you choose tilt or voltage options on on LIS3DH read blocks, and if you include the LIS3DH temperature block in your project.
The LIS3DH read block stores the sensor's measurements in variables you have created ahead of time. Choose a type of value to measure and store from the top dropdown menu:
Read about each option below.
The LIS3DH temperature block provides the temperature in the units you choose from the dropdown. When you place this block in the canvas, Set ambient temperature fields appear in the LIS3DH Initialization block. Enter the ambient temperature as taken with a separate thermometer. The operating temperature range is:
The value this block returns is not the absolute temperature. It returns the change in temperature during program run time, added to the Set ambient temperature value you entered in the LIS3DH Initialization block. So, if the temperature does not change during program run time, this block will return whatever Set ambient temperature value you gave it, even if it is inaccurate.
Available for Activity Board, FLiP and Other board types. Not available for Badge or Scribbler Robot board types.
The LSM9DS1 9-axis IMU (#28065) [17] measures acceleration, rotation, and magnetic field strength along three perpendicular axes, shown and labeled in the image below:
The IMU initialize block sets up the communication between the Propeller chip and the compass module.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget to use this block, a triangle warning icon will appear on other IMU blocks as a reminder:
Set each drop-down to match the Propeller I/O pins connected to the IMU's SCL, SDIO, CS_AG, and CS_M pins. It is not necessary to connect the INT_A/G or INT_M pins. However, they may be read using a check PIN block if they are connected. I/O pins available will vary by board type.
The IMU calibrate magnetometer block is used to calibrate the magnetometer on the IMU module.
Use this block immediately after the IMU initialize block. Hold the IMU (or your project that includes the IMU) flat but in a space with enough room to rotate it around. Once the calibration has started, if you are using the ActivityBoard or FLiP, the P26 and P27 LEDs will turn on.
Once the calibration has started, it will collect samples for 30 seconds.
If you only plan to use the IMU as a compass (for heading using 2 of the axes), you will want to set your device flat and rotate it slowly around during the 30-second sample collection. If you need all 3 axes calibrated, you will need to slowly rotate your project around each of the IMU's 3 axes during the 30 seconds sample collection.
You do not need to repeat the calibration again unless your environment (such as moving your project into or out of a building) or your location changes.
The IMU read block stores the current accelerometer, gyroscope, or magnetometer measurements from each of the 3 axes into the specified variables. The Accelerometer measurements are in g-100ths. This means that a measurement of 1 g (1 Earth gravity) of acceleration will read as +100 in one direction or -100 in the opposite direction. Gyroscope measurements are in hundredths of degrees of rotation per second (DPS-100ths). Magnetometer measurements are in gauss-100ths.
The IMU tilt block stores the current tilt angles measured by the IMU's accelerometer, measured in degrees as an integer, ranging from -180 to 180. You must specify the axis that is pointing up/down (vertically) to ensure that your measurements are correct. The tilt of the remaining to axes are then stored in the variables specified by their respective drop-down menus.
The IMU heading block stores the current unadjusted heading measured by the IMU's magnetometer, in degrees as an integer, ranging from 0 to 359. You must specify which axes are pointed in which directions relative to the observer for the code to correctly resolve the compass heading.
Calibrate your IMU's magnetometer before using the IMU heading block. You may also need to re-calibrate it if your environment or location changes from the last time it was calibrated.
Compatible with the Propeller Activity Board WX, Propeller FLiP, or Other board types. Not available for Badge or Scribbler Robot board types.
These blocks are for using the MMA7455 3-axis accelerometer module (#28526, discontinued) [18].
An acceleration meter (accelerometer) senses the forces that acceleration and gravity exert on a small mass inside the sensor. Think about that feeling of being pressed into your seat back as your car speeds up rapidly. Now think about the feeling of how gravity pulls you to the ground. Those are examples of the forces that an accelerometer senses and reports. The MMA7455 is a 3-axis accelerometer module that can measure up to +/- 8g of acceleration in 3 axes up to 250 times per second.
The Accelerometer initialize block is used to set up the MMA7455 accelerometer module. Match each dropdown menu to the Propeller I/O pin connected to the CS, DATA, and CLK pins on the accelerometer module.
(The drop-down options go from 0 to 27, but do not set higher than 17 with the Propeller Activity Board WX, as P18-P31 are already connected to other built-in circuits on this board.)
The Accelerometer store values block stores the sensor's x-axis, y-axis, and z-axis measurements in the chosen variable items.
Propeller Activity Board WX, Propeller FLiP module, or Other board types. Propeller I/O pin availability will vary by board type. Not available for Badge or Scribbler Robot board types.
These blocks are for using the MEMSIC2125 Dual-Axis Accelerometer (#28017) [19].
New to this sensor? Click here to see an example schematic and quick Blockly program [20] to help you get started.
The PIN menu on all of the Memsic 2-Axis blocks can be set to "other." When "other" is chosen, the dropdown menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The Memsic x acceleration block returns the approximate acceleration measured by the Memsic sensor. Acceleration is measured in terms of g (acceleration due to earth's gravity): a value of +/-1250 corresponds to approximately +/- 1 g.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Xout pin.
The Memsic y acceleration block returns the approximate acceleration measured by the Memsic sensor. Acceleration is measured in terms of g (acceleration due to earth's gravity): a value of +/-1250 corresponds to approximately +/- 1 g.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Yout pin.
The Memsic rotation block measures how much the sensor is rotated if it is held vertically (zero degrees is when the triangle on the Memsic sensor is pointed straight up. The sensor returns a measurement in degrees where 0 degrees is straight up, and 180 degrees is straight down.
Set the PIN dropdowns to the Propeller I/O pin connected to the sensor’s Xout and Yout pins.
The Memsic x tilt block returns a measurement of how much the sensor has tilted in the x (sideways) direction when the top of the sensor is level with the ground. The value returned is +/- 90 degrees.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Xout pin.
The Memsic y tilt block returns a measurement of how much the sensor has tilted in the x (front to back) direction when the top of the sensor is level with the ground. The value returned is +/- 90 degrees.
Set the PIN dropdown to the Propeller I/O pin connected to the sensor’s Yout pin.
The Memsic MX2125 Dual-axis Accelerometer is great for measuring tilt, vibration, rotation, and let’s not forget its namesake, acceleration. A few MX2125 project ideas might include a tilt video game controller, tilt robot controller, robot hill climbing sensor, and radio-controlled vehicle acceleration, speed, and position data logger.
Using the connections shown in the wiring diagram above, this example will display X and Y tilt in the Terminal.
Compatible with the Propeller Activity Board WX, Propeller FLiP module, or Other board types. Propeller I/O pin availability will vary by board type. Not available for Badge or Scribbler Robot board types.
This block works with any of the Parallax PIR (passive infrared) motion sensors:
New to PIR sensors? Click here to see an example schematic and quick Blockly program [24] to help you get started.
The PIR sensor block returns a 0 (zero) if no motion is detected, and a 1 (one) if a motion is detected. The PIN dropdown must be set to the pin connected to PIR sensor’s out pin.
A PIR Sensor can tell when something nearby moves. PIR stands for "Passive InfraRed". The sensor detects the pattern of infrared energy in its surroundings. If the pattern changes, the sensor outputs a high signal. The Propeller microcontroller only needs to monitor this signal with an I/O pin to know if something is moving around nearby.
Using the connections shown in the wiring diagram above, this example will display the status of the PIR Sensor in the Terminal. A value of "1" indicates the sensor has been triggered (or set high), and a "0" is the resting (or low) state.
It is typical for the sensor to be triggered when it is first powered up and getting an infrared reading from its environment. This may last up to 30 seconds.
Compatible with Propeller Activity Board WX, Propeller FLiP module, and Other board types. Not available for Badge or Scribbler Robot board types. Use this block with the following distance sensors from Parallax:
New to these sensors? Click here to see an example schematic and quick Blockly program [27] to help you get started.
The Ping))) distance block returns the distance to an object detected by the sensor, between 1 inch (3 cm) and 124 inches (315 cm) away.
The PIN menu on this block can be set to "other." When "other" is chosen, the drop-down menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The Ping))) Ultrasonic Distance Sensor measures the roundtrip echo time of ultrasonic sound to determine how far away an object is. It can measure distances anywhere from 3 centimeters to 3 meters. In addition to being a great distance sensor for robots, it’s also useful for detecting people passing through doorways, viewing art exhibits, approaching holiday props, and more.
Parallax PING))) Ultrasonic Distance Sensor (left) and Parallax Laser PING (right).
ActivityBot Alert! Use a different I/O pin if your board is on a robot - a servo is connected to P15!
Use a 2 k-ohm resistor (red-black-red) between the PING))) sensor's SIG pin and the Propeller I/O pin.
Using the connections shown in the wiring diagram above, this example will display PING))) distance measurements in the Terminal Window.
Use this block with the serial RFID Reader (#28140) [28] and the Propeller Activity Board WX, Propeller FLiP module, and Other board types. Not available for Badge or Scribbler Robot board types.
New to this sensor? Click here to see an example schematic and quick Blockly program [29] to help you get started.
This block launches a processor automatically. Use one instance of this block per project.
The RFID initialize block is used to set up the Parallax RFID module. The EN and SOUT pins on the module must be matched to the Propeller Activity Board pins they are connected to.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
The RFID read block reads the ID number from an RFID tag near the sensor. If no tag is detected, it provides a value of 0 (zero).
The RFID disable/enable block depending on the option chosen in the dropdown menu, disables or enables the RFID sensor.
The RFID close block closes the RFID object and frees up the resources the object was using inside of the Propeller microcontroller.
RFID stands for Radio Frequency Identification. The Parallax RFID Reader Serial + Tag Sampler (#32390) [30] includes several unique RFID tags.
Using the connections shown in the wiring diagram above, this example will display the unique identification number(s) of your RFID tag(s) in the Terminal. Please note this code is for the Serial RFID Reader, not the USB version.
Compatible with all Propeller board types
Use this block with a Sony protocol Infrared Remote (#020-00001) [31] and infrared receiver (#350-00039)
New to this sensor? Click here to see an example schematic and quick Blockly program [32] to help you get started.
The Sony Remote value block returns a value detected by the IR receiver that indicated which button on the remote was pressed. If no button press was detected, this block provides a value of -1.
The PIN menu this block can be set to "other." When "other" is chosen, the drop-down menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
An IR receiver can detect bursts of infrared light sent by a common remote controller (like for a television), and then output a pattern of high/low signals to a Propeller I/O pin.
Configure your remote for the Sony protocol, following its manufacturer instructions. (If you purchased the Brightstar brand remote from Parallax, hold the Setup button until the light near it comes on. Enter 6-0-5 and the light should go off. Done!)
Using the connections shown in the wiring diagram above, this example displays the number of the button pressed on your remote in the Terminal. When no button is pressed, the Sony Remote value block sends a -1, and the message Button press = none will appear in the Terminal.
These blocks are for Parallax's Sound Impact Sensor (#29132) [33] and the Propeller Activity Board WX, FLiP, or Other board types. Not available for Badge or Scribbler Robot board types.
New to this sensor? Click here to see an example schematic and quick Blockly program [34] to help you get started
This block launches a processor automatically. Use only one instance of this block per project.
The Sound Impact initialize block sets up the Sound Impact Sensor.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget this block, the other Sound Impact Sensor blocks will display a triangle warning icon as a reminder:
The Sound Impact get count block returns how many sound impacts (loud sounds) were detected since the last time this block was used. If no sound impacts were detected, it provides a value of zero.
The Sound Impact close block makes the Propeller microcontroller stop listening to the Sound Impact Sensor and frees up the resources it was using inside of the Propeller.
The Sound Impact Sensor detects sound from up to 3 meters away, lending noise-activation possibilities to your microcontroller projects
Use a 2.2 k-ohm resistor (red-red-red) between the Sound Impact Sensor's SIG pin and the Propeller I/O pin.
Using the connections shown in the wiring diagram above, this example will display "Sound detected!" if the sensor detects one or more sound events, and "No sound detected." otherwise.
Available for Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types. I/O pin range options will vary with board type.
These blocks are for the CM2302 Temperature & Humidity Sensor (#28059 [35]). It is also compatible with most DHT22 and AM2302 models.
See the next page for a Getting Started tutorial, and/or watch the Tiny Tutorial video below.
The Temp & Humidity read block triggers a supported sensor connected to the specified I/O pin to take and store temperature and relative humidity readings. Readings can be updated every 30 seconds.
The PIN menu this block can be set to "other." When "other" is chosen, the dropdown menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The Temp & Humidity value block provides the specified measurement from the data stored by the last Temp & Humidity read block. Choose the type of data from the drop-down menu. Options are:
BlocklyProp uses integer math: The value returned by this block is 10 times the temperature or relative humidity measured by the sensor. To display the reading, use a print multiple block's floating point option for the Terminal, LCD, or OLED, and choose to divide the value by 10 on that block. See the wiring diagram and example code on the next page.
The CM2302 Temperature and Humidity Sensor can take a reading of temperature and relative humidity for use by a microcontroller such as the Propeller.
The example code below displays the temperature and relative humidity in the BlocklyProp Terminal. BlocklyProp uses integer math; the Temp & Humidity value block provides a value that is 10 times larger than the sensor reading.
To display the sensor readings as floating-point values, use the Terminal print multiple block. Click its gear icon, drag in text and floating point number blocks, and then click specify digits box:
Here is the complete code listing:
Save and run the project to display the data in the BlocklyProp Terminal:
Links
[1] http://www.parallax.com/product/27800
[2] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/2-axis-joystick/joystick-wiring-example
[3] http://www.parallax.com/product/27899
[4] https://learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/sensor/4-x-4-keypad/4x4-keypad-wiring
[5] https://www.parallax.com/product/28061
[6] http://www.parallax.com/product/28380
[7] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/colorpal/colorpal-wiring-code-example
[8] http://learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/values
[9] https://www.parallax.com/product/29126
[10] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/fingerprint-scanner/fingerprint-scanner
[11] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/gps/gps-wiring-example-code
[12] https://learn.parallax.com/sites/default/files/content/AB-Blockly/Reference/Parallax-BlocklyProp-GPS-Data.zip
[13] https://solo.parallax.com/
[14] https://www.parallax.com/product/29133
[15] https://solo.parallax.com
[16] https://www.parallax.com/product/29020
[17] http://www.parallax.com/product/28065
[18] https://www.parallax.com/downloads/mma7455-3-axis-accelerometer-module-documentation
[19] http://www.parallax.com/product/28017
[20] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/memsic-2-axis/memsic-2125-wiring-example
[21] http://www.parallax.com/555-28087
[22] http://www.parallax.com/product/28083
[23] http://www.parallax.com/product/28032
[24] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/pir/pir-wiring-example-code
[25] https://www.parallax.com/product/28015
[26] http://www.parallax.com/product/28041
[27] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/ping-distance/ping-wiring-example-code
[28] https://www.parallax.com/product/28140
[29] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/rfid/rfid-wiring-example-code
[30] https://www.parallax.com/product/32390
[31] https://www.parallax.com/product/020-00001
[32] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/sony-remote/ir-remote-wiring-example-code
[33] http://www.parallax.com/product/29132
[34] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/sound-impact-sensor/sound-impact-wiring
[35] http://www.parallax.com/product/28059