makecode NTC Temperature Sensor extension for microbit
Author: shaoziyang
Date: 2018.Mar
open your microbit makecode project, in Extensions, paste
https://github.com/makecode-packages/NTC
to search box then search.
let AmbientTemperature = 0
NTCSenor.set(NTC_B.B3950)
AmbientTemperature = NTCSenor.Temperature(pins.analogReadPin(AnalogPin.P1))
-
set(B: NTC_B)
B-value is a tendency for resistance in temperature change, it maybe 3380 or 3950 here. -
Temperature(adc: number)
adc is the result of analog input. Function will return temperature in degree Celsius.
MIT
Copyright (c) 2018, microbit/micropython Chinese community
- for PXT/microbit