Just started playing with an RPi Pico W and making an ESPHome device with it. Does anyone have guidance/links/whatever for how to use one or both of the onboard temperature sensor and LED? I’ve tried both General Googling and also searches on this site…
Thanks in advance for any help you are able to give.
@nickrout indeed; IIRC, the onboard LED is connected to the Wifi controller; not sure about the temperature sensor. I don’t think it’s on a GPIO pin though. I’ve had the LED working in both uPython and C++. The Temperature sensor only in uPython. TBH the onboard LED is probably really only cosmetic; useful in test/example scenarios only. The onboard temperature sensor is another matter, though. It’d be really nice for it to be usable from ESPhome. I suspect it needs support in ESPhome; to have a platform module written for it, if that’s not been done already. For my own part, if I don’t find something after a bit more poking about around here and elswhere, I may have a go at writing a custom sensor. If I do, and if I get it working, I’ll post the code here…
// C++ Code (picow_intLED.h)
#include "esphome.h"
using namespace esphome;
// Custom binary output, for exposing binary states
class picow_intLED : public Component, public BinaryOutput {
public:
void setup() override {
// This will be called by App.setup()
pinMode(LED_BUILTIN, OUTPUT);
}
void write_state(bool state) override {
digitalWrite(LED_BUILTIN, state);
}
};