New answers tagged

0

The Keyboard::begin() and Keyboard::end() functions, if you actually look at the code are empty functions. They do nothing. In theory the compiler should just optimise them out.


0

OK so here is my solution. I made a wrapper class called SafeSerial. In SafeSerial.h: #pragma once #include <Arduino.h> class SafeSerial : public Serial_ { size_t write(const uint8_t* buffer, size_t size) override; }; In SafeSerial.cpp: /* * SafeSerial implementation for Arduino Leonardo. * Overrides the Serial_::write() method and ...


2

Theoretically, nothing should happen to serial data if nothing is listening. For a traditional UART the data is just sent regardless. It doesn't need someone listening for that to happen. Like a light doesn't need someone to see it for it to be on. For USB CDC/ACM the data should be discarded even before it's attempted to be sent. The latter, though, does ...


1

If you already have a 5V source then you can use a MOSFET as a switch to turn on/off the power to the tablet like this: But if you want to turn on/off a USB charger that goes to an AC outlet, then you will need to control a relay to turn on/off the AC supply to the USB charger. You can use a relay module like this: https://www.amazon.com/Tolako-Arduino-...


Top 50 recent answers are included