10 votes
Accepted

Arduino Nano is performing really slowly, even though the calculations are simple and there are no delays

I put in some timing into your code. As a tip for you and others who may want to time code, here is a simple way of doing that ... Timer class Define a timer class as follows: class timer { ...
Nick Gammon's user avatar
  • 37.9k
5 votes
Accepted

How does the compiler/assembler work wrt bootloader?

On the Uno and similar AVR-based boards, the compiler and assembler are not aware of the bootloader. The compiled program starts at address zero. There you have the interrupt vector table, starting ...
Edgar Bonet's user avatar
  • 42.2k
4 votes
Accepted

Arduino nano 33 BLE serial port not working with C# app

I noticed that a lot of line discipline and flow control settings were not made explicit in your C# code, so it made me wonder what they were by default. In particular DtrEnable appears to be false by ...
timemage's user avatar
  • 5,018
4 votes
Accepted

"if" condition problem / question

The timings are different. Every operation on the LCD takes time. This: lcd.clear(); lcd.setCursor(0, 0); lcd.print(cnt); involves some I2C communication, and thus takes orders of magnitude more time ...
Edgar Bonet's user avatar
  • 42.2k
3 votes

Need help individually controlling 3 LEDs with 3 toggle switches

How is your wiring done? This is a working example of how it can be done: #define LED_PIN1 5 #define BUTTON_PIN1 14 #define LED_PIN2 6 #define BUTTON_PIN2 15 #define LED_PIN3 7 #define BUTTON_PIN3 ...
Sam's user avatar
  • 133
3 votes
Accepted

Checking a thing about interrupts

See How do interrupts work on the Arduino Uno and similar boards? Yes, most interrupts will be remembered and the ISR will be executed when interrupts are enabled again, plus one more instruction has ...
Nick Gammon's user avatar
  • 37.9k
3 votes
Accepted

Change Interrupts on the ATTiny 88

Interrupt types One source says there are only two interrupt pins, ... There are two "external interrupt" pins; that is the term you'll find in the chip's datasheet. This is the term that ...
timemage's user avatar
  • 5,018
3 votes

Analog Microphone values not changing

/* edited to specifically provide a potential solution as commented by @jstola */ You have posted a picture of a ubiquitous sound detection sensor - typically a Keyes KY-037. It is based on an LM393 ...
DrG's user avatar
  • 399
3 votes

Nema 17 stepper motor speed problem

Stepper motors need to be gradually brought up to speed. If you try to go from zero rpm to anything over a few hundred rpm they will often just sit there and hum. Try AccelStepper (https://www.arduino....
Brian Robertson's user avatar
2 votes

Unable to find/connect I2C devices (SHT31 & SGP30)

I had a similar problem, but the fix turned out to be simple. All the tutorials for SHT3x sensors say to connect the VIN to the 3.3V GPIO. I checked using a test meter, the SHT3x was getting voltage ...
Hillclimb's user avatar
2 votes

Arudino receiving interrupt command BEFORE entering sleep mode causing it not to receive any interrupt commands in order to wake up

There are a couple of tricky things going on here... First, you should be aware of a few facts: Buttons are prone to mechanical bounce. You press a button once, and quite often the microcontroller ...
Edgar Bonet's user avatar
  • 42.2k
2 votes

Multiplexing three VFD tubes — why are the segments and the display timing incorrect?

I made a VFD clock using some really cool old DG10B tubes from an early calculator a year or so ago. I had a heck of a time getting it to work, until I decided try tackling one problem at a time, and ...
Jon Dresser's user avatar
2 votes

Arduino code working via IDE, not via PlatformIO Arduino code

I had a similar behavior for a while and nothing I would change in the PlatformIO .ini configuration file seemed to help. I tried to re-init and clean the project, but also didn't seem to help. ...
Mohamed Elhariry's user avatar
2 votes

converting comma delimited Serial message to 7 Unsigned Long variables

First of all, it is worth noting that the third number in you example message (100000000000, i.e. 1011) is too large to fit in an unsigned long. On AVR-based Arduinos, and most non-64-bit platforms, ...
Edgar Bonet's user avatar
  • 42.2k
2 votes
Accepted

Rotary encoder weird values

There are several problems happening here. Since your code only covers one input pin, I'm going to talk about input A. This pin is left floating! When you turn the dial, the brush connects A and/or B ...
AJ_Smoothie's user avatar
2 votes

USB serial communication arduino nano and jetson nano

I also belive its to do with the following line, data = arduino.readline() Try the following, while True: try: arduino.flushInput() // Clear buffer data = arduino.readline() // ...
S10's user avatar
  • 31
2 votes
Accepted

Confusing stepper reaction to increase in delayMicroseconds()

With dt = 500 you get one step per millisecond. This is probably too fast for the motor/driver combination. When the driver tries to execute another step, while the previous is not fully executed by ...
chrisl's user avatar
  • 15.8k
1 vote

Using Internal Timer Interrupt to Read Analog Sensor

First, read Nick Gammon's answer: all his points are perfectly valid. He notes that the serial prints can be quite slow. And indeed, as I counted the characters, I find that the prints should take at ...
Edgar Bonet's user avatar
  • 42.2k
1 vote
Accepted

Arduino Nano uploading problems

Apparently there was an update in ch340 drivers early in 2023 and it broke something for counterfeit ch340. Solution is using older version of the driver (and possibly disabling automatic updates for ...
KIIV's user avatar
  • 4,742
1 vote
Accepted

arduino nano fried (TWICE!!)

From the several Arduino Nano schematics I've found, the "fried" part you identify as the USB diode, might be a MBR0520 Schottky diode or a similar diode with a low forward voltage drop. ...
StarCat's user avatar
  • 1,577
1 vote
Accepted

How can I get the Arduino IDE v0021 running on Windows XP to communicate with the latest Nano v3.0

I agree with Juraj that any bootloader can be uploaded to the newer version of the Nano. However, the process of doing so is not simple. With Windows XP SP3 installed on my laptop I was running ...
Raistlin's user avatar
1 vote

NRF24L01 PA+LNA With Arduino

In the receiver code, you are just reading one byte, as 6v6gt pointed out. Check the library to see how read() works. If you follow the getting started example, this is how you should read bytes in ...
Fahad's user avatar
  • 544
1 vote

Making a servo work for just once after a specific time period without hindering the sensors that are reading the data in a loop

I assumed you would want to collect the data after you opened the parachute. And as Delta_G suggested, you would want to open the parachute as fast as possible and not gradually. I also assumed you ...
Fahad's user avatar
  • 544
1 vote
Accepted

Bad readings from 12V pwm fan tachometer signal

1. Open Collector Output of a module. The power for the open collector output should come from the MCU, not (indirectly) from the sensor's power supply. It is very similar to wiring a push button ...
6v6gt's user avatar
  • 1,018
1 vote

50% duty cycle PWM signal with calculated frequency

Let's look at what's possible using the Atmega328P (which is on the Nano). The timers are really just counters, with the input to the counter being the system clock, possibly after being divided down ...
Nick Gammon's user avatar
  • 37.9k
1 vote
Accepted

Have I ruined my Arduino Nano with my terrible soldering (technique and tools!)

You haven't answered either of my questions in the comments (where is the component?, what colour is it?) but judging by the position I think it is on the board it is the 0.1 µF capacitor which is ...
Nick Gammon's user avatar
  • 37.9k
1 vote

Why is Arduino not visible in MacOS USB port list?

This is a common problem as judged by online questions. The most common solution seems to be to install the special CH34X device driver on the Mac for the USB port, but I'm suspecting many people ...
Ted Toal's user avatar
1 vote
Accepted

How to connect Arduino Nano to Thermal Printer via serial connection

Your additional info about your printer tells me that it has a Bluetooth and a USB interface - but I can not see any other serial connection port. So there is no way connecting this printer as-is to ...
datenheim's user avatar
  • 156
1 vote

variable 'LiquidCrystal_I2C lcd' has initializer but incomplete type

Normally I wouldn't answer this, but the error is not exactly in your code but (seemingly at least) in two common things in the Arduino ecosystem. Roughly speaking, the library you're trying to use is ...
timemage's user avatar
  • 5,018
1 vote
Accepted

Serial port stops receiving data after random amount of time

I tried powering all of the sensors with an external power source and this seems to solve the issue, I got consistent readings from all the distance sensors and the serial port did not stop receiving ...
Jin Yuan's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible