Component: Temp / Humidity (Grove 101020019) (101020019) (Environmental)
From Flowcode Help
Jump to navigationJump to search
| Author | Matrix TSL |
| Version | 1.2 |
| Category | Environmental |
Contents
Temp / Humidity (Grove 101020019) component
The DHT22 temperature and humidity sensor is a popular sensor allowing the ambient temperature and relative humidity to be monitored digitally. Humidity Range = 0% - 100% +/- 2% Temperature Range = -40 - 80 Degrees C +/- 0.5 Degrees C
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
| GetTempWhole | |
| Gets the whole number portion of the temperature returned by calling SampleSensor. If temperature is 15.8 degrees C then this function would return 15. | |
| [[File:]] - | Return |
| GetHumidityFloat | |
| Gets the humidity returned by calling SampleSensor as a floating point number. If humidity is 15.8 % then this function would return 15.8. | |
| [[File:]] - | Return |
| GetTempString | |
| Gets the temperature returned by calling SampleSensor as a string. If temperature is 15.8 degrees C then this function would return "15.8". | |
| Return | |
| GetHumidityString | |
| Gets the humidity returned by calling SampleSensor as a string. If humidity is 15.8 % then this function would return "15.8". | |
| Return | |
| GetHumidityWhole | |
| Gets the whole number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 15. | |
| [[File:]] - | Return |
| GetTempReal | |
| Gets the real number portion of the temperature returned by calling SampleSensor. If temperature is 15.8 degrees C then this function would return 8. | |
| [[File:]] - | Return |
| GetHumidityReal | |
| Gets the real number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 8. | |
| [[File:]] - | Return |
| SampleSensor | |
| Communicates with the DHT11 sensor and receives the temperature and humidity readings. Returns 0 for success, 1 for no communication detected and 2 for checksum error. | |
| Return | |
| GetTempFloat | |
| Gets the temperature returned by calling SampleSensor as a floating point number. If temperature is 15.8 degrees C then this function would return 15.8. | |
| [[File:]] - | Return |
| Initialise | |
| Starts up the I2C bus and initialises the pressure sensor ready for use. Returns 1 for a sucessful startup. Returns 0 for a failed startup or no device detected. | |
| Return | |
| Initialise | |
| Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
| Return | |
| SampleAccel | |
| Samples the accelerometer 0 = no new data, 1 = new data available | |
| Return | |
| Left | |
| Rotates the robot left - waits for the angle to be traversed before returning | |
| Angle | |
| Angle to turn in degrees | |
| Return | |
| LCDDrawPixel | |
| Allows a single pixel on the LCD to be set or cleared | |
| X | |
| X Pixel 0-127 | |
| Y | |
| Y Pixel 0-31 | |
| State | |
| 0=White (Off), 1=Black (On) | |
| Return | |
| ServoSetPosition | |
| Allows one of the servo positions to be assigned | |
| Channel | |
| Range 0-3 | |
| Position | |
| Range 0-255 | |
| Return | |
| CardBitmap | |
| Displays a monochrome bitmap read from the card on the LCD | |
| X | |
| Range 0-127 | |
| Y | |
| Range 0-31 | |
| Filename | |
| Return | |
| CardOpen | |
| Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK | |
| Filename | |
| Return | |
| Forwards | |
| Drives the robot forwards - waits for the distance to be traversed before returning | |
| Distance | |
| Distance in mm | |
| Return | |
| ReadBearing | |
| Reads the compass bearing based on the degrees clockwise from magnetic north. | |
| [[File:]] - | Return |
| GetConsoleHandle | |
| Gets the handle to the console allowing data displaying on the panel etc. | |
| [[File:]] - | Return |
| LCDDrawLine | |
| Allows a single pixel width line to be drawn on the LCD | |
| X1 | |
| X Pixel 0-127 | |
| Y1 | |
| Y Pixel 0-31 | |
| X2 | |
| X Pixel 0-127 | |
| Y2 | |
| Y Pixel 0-31 | |
| Return | |
| ServoAutoMoveToPosition | |
| Allows one of the servo positions to move gradually to a new position | |
| Channel | |
| Range 0-3 | |
| Position | |
| Range 0-255 | |
| Return | |
| ReadAllValue | |
| Reads a single value stored from the read all command Index dictates which sensor value to read | |
| Index | |
| 0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel | |
| Return | |
| LCDBacklight | |
| Allows the LCD backlight brighntess to be adjusted | |
| Intensity | |
| Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness | |
| Return | |
| LCDDrawRect | |
| Allows a rectangle to be drawn on the LCD | |
| X1 | |
| X Pixel 0-127 | |
| Y1 | |
| Y Pixel 0-31 | |
| X2 | |
| X Pixel 0-127 | |
| Y2 | |
| Y Pixel 0-31 | |
| Return | |
| ReadLine | |
| Reads one of the IR line sensors 0-1 0=Left, 1=Right | |
| index | |
| 0=Left, 1=Right | |
| Return | |
| ServoDisable | |
| Allows one of the servo outputs 0-3 to be disabled | |
| Channel | |
| Range 0-3 | |
| Return | |
| ServoEnable | |
| Allows one of the servo outputs 0-3 to be enabled | |
| Channel | |
| Range 0-3 | |
| Return | |
| CardReadByte | |
| Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end | |
| Return | |
| CardErase | |
| Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK | |
| Filename | |
| Return | |
| CardWriteByte | |
| Appends a byte to the end of the currently open file | |
| Data | |
| Return | |
| EncoderRead | |
| Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. | |
| index | |
| 0=Left, 1=Right | |
| Return | |
| SetMotors | |
| Sets the motor speeds without feedback Range -100 to 100 | |
| [[File:]] - | Left |
| Range -100 to 100 | |
| [[File:]] - | Right |
| Range -100 to 100 | |
| Return | |
| Backwards | |
| Drives the robot backwards - waits for the distance to be traversed before returning | |
| Distance | |
| Distance in mm | |
| Return | |
| EncoderReset | |
| Resets the motor encoder counters | |
| Return | |
| LCDVerbose | |
| Allows the LCD to automatically report the API commands as they get processed. Default - verbose on | |
| State | |
| 0=Off 1=On | |
| Return | |
| SetProp | |
| Allows the COM port property to be set from a parent component. | |
| PropName | |
| PropVal | |
| Return | |
| CardInit | |
| Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK | |
| Return | |
| GetProp | |
| Allows the property filter for the COM port list to be copied to a parent component. | |
| PropName | |
| Return | |
| LCDClear | |
| Clears the LCD | |
| Return | |