New answers tagged

0

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-...


0

I have some experience with the the screen you are using and I hope these tips can solve your problem. Changing the Address in the code The OLED display you are using uses what is called I2c or IIC protocol which is the abbreviation of "Inter Intergrated Circuit", here is it's Wikipedia page to read about it. The IIC communication has 7 bit address space, ...


0

After trying different approaches I decided to dumb it down to its most basic level. Without any fancy coding or buffers, I'm now just writing the data directly to the SD-card and flushing every 15 seconds which has the risk to loose up to 15 seconds of data i.e. 15 GPS-fixes (1 per second) when cutting off power. The only other time where a potential data ...


1

Practically forever. Rather make sure the contacts don't become too rusty. ( 83.7 % of Arduino problems are mechanical and contact issues :) ) Will your grandchildren still have a legacy USB cable and be interested in that thing and your c++ coding skills then?


0

upto 20 years at 85°C and upto 100 years at 25°C


5

More than 20 years, and probably more than 100 years. That's the guaranteed minimum: Data retention: 20 years at 85°C/100 years at 25°C(1) (1) Reliability Qualification results show that the projected data retention failure rate is much less than 1 PPM over 20 years at 85°C or 100 years at 25°C.


0

I assume you are powering the Nano through VIN or USB, and you are then powering the LED strip from the Nano's 5V pin. From the 12V battery the current flows through an LM1117 linear voltage regulator. Draw too much current (>800mA) and it will overheat and either shut down (if it's a good one) or melt (if it's an inferior Chinese clone). From USB the ...


3

You can connect via: UART I2C SPI All are available on the Pi's GPIO header and on the Arduino. You will of course need logic level translation for a 5V Arduino. Using UART is probably simplest for you since that is identical to using the USB - you just use /dev/ttyS0 (or /dev/ttyAMA0 on older Raspberries) instead of /dev/ttyUSB0 or /dev/ttyACM0. Just ...


0

Two different bootloaders are used for ATmega328p. One is used in Uno, it is based on Optiboot 4. Second is used in Arduio Nano and is based on Atmel bootloader. Arduino replaced the old Nano bootloader with the Uno Optiboot bootloader in 2018, but Nano clones and old Nanos still in use have the old bootloader. In current AVR boards package version there is ...


1

The bootloader doesn't care about how many pins the device has. All it cares about is the UART pins, and they are the same. Internally the two chips are the same, it's just the packaging that is different. They take the same silicon chip and mount it on a different lead frame and encapsulate it in epoxy. Which is why the only pin differences are a couple of ...


1

It's impossible to say for sure what is going on without proper equipment (mostly you need oscilloscope), but I'm pretty sure that due to very high current consumption of the motors, there are voltage spikes at the input of the voltage regulator. If voltage exceeds safe value (15V for most of them), then regulator fails and all the input voltage is now on ...


0

Read the port state with PIND Isolate the bit you want with & Profit if (PIND & 0b0100000) { val |= 1; } Or, as a ternary: val |= ((PIND & 0b01000000) ? 1 : 0);


-1

I remember Answering similar question somewhere. Do not worry about Arduino sharing 12V supply with LEDs. Any supply with CE mark (I would have expected that to be standard in Russia and nearby countries) would be unlikely to spike above the means of arduinos voltage regulator. There is a small chance that your supply may assume the consumption is too low ...


1

You could do something like this. (not tested) void colorWipeUP(byte red, byte green, byte blue, int SpeedDelay) { for (int i = -5; i < NUM_LEDS + 5; i++) { setPixel(i , red, green, blue); // example only setPixel(i + 1, .8 * red, green, blue); // change the green and blue also setPixel(i + 2, .6 * red, green, blue); ...


3

Your code is currently written as blocking, so we can leave it that way and add another blocking nested loop. Let's take the colorWipeUP() function as example: void colorWipeUP(byte red, byte green, byte blue, int SpeedDelay) { for (uint16_t i = 0; i < NUM_LEDS; i++) { setPixel(i, red, green, blue); FastLED.show(); delay(SpeedDelay); } } ...


2

I think your main problem is how you read the buttons. You simply connected the buttons with ground and the corresponding digital input pin on the Arduino without any extra components, just like the linked forum entry states. But you missed a very important part: The pullup resistor. When your button is pressed, the Arduinos pin will be pulled to ground. ...


1

You should always comment your code, so that you will know what your code does when you look at it 6 months from now. For beginners, you should not leave out the braces {} from any part of the code as you did in the for loops. Here is your code correctly formatted, followed by a more cleaned up version which may be easier for beginner to follow. Main ...


Top 50 recent answers are included