Questions tagged [arduino-mega]
A microcontroller board based on the ATmega2560 or 1280 chip. Use this tag for questions specifically regarding the Mega, and not just general Arduino usage.
1,822 questions
0
votes
0
answers
43
views
After an USB disconnect the program I've uploaded to the Arduino Mega 2560 doesn't work properly anymore, why?
For a race simulator I'm using several Arduino Mega 2560 boards on which the code that will post below will be running. (not my code! But freely available on the internet)
Everything works fine, just ...
4
votes
2
answers
1k
views
Arduino Mega: is there a way to have additional interrupt pins?
I have an Arduino Mega, and I run out of interrupt pins. I have only pin 18 available, but I need 2 of them. What can I do?
pin
INTx
digitalPinToInterrupt(pin)
3
INT5
1
2
INT4
0
18
TX1 INT3
5
19
RX1 ...
1
vote
1
answer
112
views
Arduino Mega 2560 + DRV8871: Motor Not Moving with PWM Control
I'm using an Arduino Mega 2560 to control a DRV8871 motor driver connected to a DC brushed motor. The setup includes:
Three buttons: UP, DOWN, and FAST
One limit switch input, where the upper and ...
2
votes
1
answer
187
views
Software serial communication problem between ESP8266 and Arduino Mega for plant monitoring system (using Blynk IoT)
We're using the ESP8266 to receive data from the Arduino Mega board, where our sensors are connected. Supposedly, our ESP is connected to the Blynk App. However, the values showing up in our dashboard ...
3
votes
1
answer
303
views
Interrupt routine has unexpected execution
An interrupt routine is executing unexpectedly, and I can't figure out why. Can you please have a look?
Hardware is a generic (knock off) Arduino Mega, with an unused Ethernet shield, and a touch ...
0
votes
1
answer
79
views
How to use C++ user defined modules in Arduino
Does Arduino support C++ module import functionality i.e. what would it require to implement something like this in Arduino: import std;?
-1
votes
1
answer
65
views
Arduino connect programatically two wires of external 3.3V device
What is a missing puzzle in here, relay, transistor?
I would like to pull pin of external device to the ground programatically using arduino's digital pin.
1
vote
1
answer
350
views
Different pin names in 0V7670 Camera Module
I am trying to follow this tutorial, SIMPLIFIED! How to Use OV7670 Camera with Arduino (other tutorials are also the same) and I noticed that my Camera module has different pin names, what do I do?
...
2
votes
2
answers
221
views
interrupt from a button and wait until serial port 1 has a message
I'm a little bit loss because I'm learning how to use the interruptions on Arduino.
I'm creating a program to read an RFID code that arrives if an RFID transmitter is close to the antenna (a little ...
0
votes
1
answer
116
views
Problem with char* variable malloc/free. Empty contents on recipient variable after using free
I am working on a custom SD card data logger using the following function and struct:
char *filenameCreator(const char *prefix, const char *num, bool addExtension)
{
char *filename = (char *)...
0
votes
1
answer
365
views
LED control with a string variable
I would like to control three LEDs with a string variable using an Arduino Mega.
I have connected the three LEDs to pins 10, 11 and 12 of the Arduino.
If my string equals Red, the red LED should turn ...
1
vote
3
answers
908
views
Best way to send a boolean (1/0) to a windows application in real time?
I have an arduino mega connected to a light sensor that reads the status of a machine's indicator light. I have a C++ application that controls the machine, and I would like the arduino to send the ...
0
votes
1
answer
1k
views
Turn on by long press of a button?
In my project on Arduino, I want to implement turning on the whole circuit by long press of a button.
But at the same time, I want the Arduino to be turned off in standby or sleep mode, but I don't ...
0
votes
2
answers
356
views
DS3231 with Arduino Nano for Timing precision
I need to synchronize two separate circuit boards working with Arduino Nano. The need is to activate one relay using Arduino-1 after 45 minutes, and another relay using Arduino-2 after 45.36 seconds. ...
1
vote
0
answers
136
views
Problem with sending a GET request using the WiFiEsp library
Hello I am trying to make a request using WiFiEsp library but even the examples not working, I have searched a lot but never solved it. most of the solutions are outdated and do not solve anything, I ...
0
votes
2
answers
1k
views
RMS Voltage Value
it has been a week that I'm struggling with the arduino to measure the RMS Voltage value. By OSC I can see that the RMS voltage value changes around 3V. But I can't see it by serial port. I think my ...
5
votes
1
answer
18k
views
Arduino /dev/ttyUSB0 permission denied even when user added to group "dialout' on Ubuntu 18.04
I bought Arduino Mega board (CH341 usb) and I am able to connect to /dev/ttyUSB0 (upload to device) only by using sudo.
OS: Ubuntu 18.04
What I've tried:
I have downloaded Arduino IDE and added my ...
29
votes
8
answers
21k
views
Are global variables evil in Arduino?
I'm relatively new at programming and many of the coding best practices I'm reading effectively state that there are very few good reasons to use a global variable (or that the best code has no ...
1
vote
1
answer
379
views
ArduinoJson library: how much space to allocate for serialized buffer?
I am using the fantastic ArduinoJson library for working with JSON data on my ESP8266. I have been facing issues with random software wdt resets and have been investigating memory leaks wherever I can....
1
vote
0
answers
463
views
Arduino (Mega 2560) Ethernet Shield 2 (W5500) - Can't connect
I'm having issues connecting to my arduino mega via ethernet. Its a very basic start to the code just to get the network side up and running, them im going to add in what I actually want it to do. For ...
2
votes
1
answer
709
views
MFRC522 board not detected. Red LED lighting
Mega 2560.
I can't get the RFID board detected. The code is as below, and outputs Didn't find MFRC522 board.. I also tested some other library and test code with success.
I triple checked the wires (3,...
29
votes
8
answers
40k
views
How can I get a unique ID for all my Arduino boards?
Once you have uploaded a sketch to one of your Arduino boards, it is hard to know exactly what source code led to that sketch.
Indeed, you may change the source code of your sketch on your PC without ...
0
votes
2
answers
147
views
Pressure transducer returns 2.4v at 0 psi when working with a 0.5v to 4.5v pressure transducer
I have this pressure transducer:
https://www.amazon.co.uk/dp/B07YZL6TYD?psc=1&ref=ppx_yo2ov_dt_b_product_details
The transducer has a range of 0.5v to 4.5v which translates to 0 psi to 100 psi.
...
5
votes
1
answer
12k
views
Wrong documentation for Mega2560 SPI Pins?
This page https://store.arduino.cc/usa/mega-2560-r3 contains an image under the Documentation section which shows digital pins 10 to 13 with labels SS, MOSI, MISO, and SCK.
EDIT: The documentation ...
1
vote
1
answer
537
views
Arduino Mega Loopback Test with Several TX/RX Ports
I am trying to do a loopback test using an Arduino Mega. What I am looking to do is send a byte over TX and receive said byte back at RX and verify that the byte is unchanged. More or less I just have ...