microsoft / devicescript

TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
https://microsoft.github.io/devicescript/
MIT License
3.25k stars 116 forks source link

mcuTemperature block #514

Closed louisvangeldrop closed 1 year ago

louisvangeldrop commented 1 year ago

The following code blocks at a Seeed Studio Xiao ESP32C3:

import { Control } from "@devicescript/core"

const control = new Control() // ... const value = await control.mcuTemperature.read()

pelikhan commented 1 year ago

Arg, Control is one of those services you should not instantiate yourself. Check out this doc https://microsoft.github.io/devicescript/developer/mcu-temperature/

louisvangeldrop commented 1 year ago

Thx. It works now. I searched for mcuTemperature and found the sample using the control object.

pelikhan commented 1 year ago

Ha I need to fix the docs on Control...

pelikhan commented 1 year ago

fix https://github.com/microsoft/devicescript/commit/cba6d1f0e60d9472be334420bb71d5763566e306