全文搜索结果:
- 温湿度计 @circuitpython:开发板:clue:demo
- 湿度计 ====== <code python> """Monitor customisable temperature and humidity ranges, with an optional audible ala... """ from adafruit_clue import clue # Set desired temperature range in degrees Celsius. min_temperature = 24 max_temperature = 30 # Set desired humidity range in percent. min_humidity = 20 max_humidity = 65 # Set
- 用舵机指示温度 @microbit:趣味程序:makecode
- fun]]例程,使用microbit控制舵机显示温度 <code javascript> let temperature = 0 basic.forever(function () { temperature = input.temperature() if (temperature < 20) { temperature = 20 } else if (temperature > 35) { temperature
- hts221 @micropython:mpy-lib:sensor
- 器 <code python| HTS221.py> # HTS221 Humidity and temperature micropython drive # ver: 2.0 # License: MIT # Aut... (reg) + self.getreg(reg+1) * 256 # calculate Temperature def temperature(self): try: self.ONE_SHOT(1) return round((self.T0_degC + ... except MemoryError: return self.temperature_irq() # calculate Humidity def humidity(
- stts751温度传感器 @micropython:mpy-lib:sensor
- S751 i2c = I2C(1) stt = STTS751.STTS751(i2c) stt.temperature() </code> 在irq中的使用方法 <code python> from machine... TS751.STTS751(i2c) def tim_irq(t): print(stt.temperature_irq()) tim = Timer(1, freq = 1) tim.callback(tim... e> **驱动源码** <code python| STTS751.py> # STTS751 temperature seneor micropython drive # ver: 1.0 # License: MI... ATUS) < 0x80: return def temperature(self): try: self.ONE_SHOT()
- lps22气压传感器 @micropython:mpy-lib:sensor
- _STATUS) & b: return def temperature(self): self.ONE_SHOT(2) try: ... except MemoryError: return self.temperature_irq() def pressure(self): self.ONE_S... f get(self): try: return self.temperature(), self.pressure() except MemoryError: ... .25 / self.pressure())**(1/5.257)) - 1.0) * (self.temperature() + 273.15) / 0.0065 def temperature_irq(sel
- makecode变量和函数命名准则 @microbit:makecode
- 性使用“get”(返回参数或属性),只需为访问的值使用一个名称。不要在名称中添加 in 或 ''.temperature get getTemperature get_Temperature'' <code javascript> // not "get temperature"! export function temperature() { .... } </code> * 将所有代码放在命名空间下以避免名称冲突。如果相似的API名称位于不同的命名空间中,则可以通过这种方式避免名
- mpl115a1驱动 @microbit:micropython:驱动库
- econds class MPL115A1: """Read pressure and temperature from MPL115A1 SPI sensor. Adapted from https:... measurement (CMD_START) and read pressure and temperature data (CMD_DATA). """ CMD_COEFS = bytearr... at mean sea level self.T = 0 # measured temperature self.altitude = altitude def _spi_en
- 内部温度传感器 @micropython:开发板:rpipico:demo
- 使用了ADC的通道4,但是读取的数字并不是温度,而是需要进行转换。计算公式为: <code -> temperature = 27 - (reading - 0.706)/0.001721 </code> 官方给出的*... = sensor_temp.read_u16() * conversion_factor temperature = 27 - (reading - 0.706)/0.001721 print(temperature) utime.sleep(2) </code>
- lis2dw12 @micropython:mpy-lib:sensor
- 2DW12_OUT_Z_L) return self.irq_v def temperature(self): try: return self.int16... except MemoryError: return self.temperature_irq() def temperature_irq(self): self.getreg(LIS2DW12_OUT_T_L+1) if self.rb[0] & 0x80: se
- lsm6dso陀螺仪传感器 @micropython:mpy-lib:sensor
- lf.get_g_raw() return self.irq_v def temperature(self): try: return self.int16... except MemoryError: return self.temperature_irq() def temperature_irq(self): self.getreg(LSM6DSO_OUT_TEMP_L+1) if self.rb[0] & 0x80:
- demo @circuitpython:开发板:clue:demo
- }".format(value)) time.sleep(0.1) </code> 温度(temperature) <code python> from adafruit_clue import clue print("Temperature: {:.1f}C".format(clue.temperature)) </code> 湿度(humidity) <code python> from adafruit_clue import clue impor
- sht20温湿度传感器 @micropython:mpy-lib:sensor
- ht20.py> ''' mpy drive for SHT20 Humidity and Temperature Sensor Author: shaoziyang Date: 2020.1... return self.ht[0]*256+self.ht[1] def temperature_raw(self): self.measure(0xf3, 85) ... raw): return (125*raw//65536) -6 def temperature(self, raw): return 175.72*raw/65536 - 46.
- bmp280气压传感器 @microbit:micropython:驱动库
- self._P7) >> 4) return [self.T, self.P] # get Temperature in Celsius def Temperature(self): self.get() return self.T # get Pressure in Pa def Pressure(self):
- esp8266快速指南 @micropython:主要硬件平台:esp8266
- hine d = dht.DHT11(machine.Pin(4)) d.measure() d.temperature() # eg. 23 (°C) d.humidity() # eg. 41 (% RH) d = dht.DHT22(machine.Pin(4)) d.measure() d.temperature() # eg. 23.6 (°C) d.humidity() # eg. 41.3 (% R
- display_sensor_data @circuitpython:开发板:clue:demo
- m".format(clue.altitude) clue_data[5].text = "Temperature: {:.1f} C".format(clue.temperature) clue_data[6].text = "Humidity: {:.1f} %".format(clue.humidity) clu