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 ...
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 ...
1
vote
2
answers
129
views
Arduino keeps restarting with L9110 and DC motor
I am trying to control a DC motor using the L9110 motor driver and Arduino MEGA 2560.
Here's the code.
#include <Arduino.h>
const int rightA = A3;
const int rightB = A2;
void setup() {
...
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;?
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 ...
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?
...
-1
votes
1
answer
46
views
Fail to discard the character T from my transmitter Arduino
I wrote code for my transmitter Arduino. I want to send the data to the receiver Arduino through Tx and Rx serial.
The issue is that I could not discard the char "T" and it appears as output ...
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
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
1
answer
2k
views
How to handle class initialization when using brace-enclosed initializer lists
I'm working with a custom C++ library, CPSTL, for Arduino, which includes a cpstd::vector class that is designed to work with cpstd::initializer_list, cpstd::initializer_list is supposed to mimic std::...
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.
...
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
1
answer
314
views
DS18B20 Error in Proteus 8.13
I am using the below code to check temperatures from 36 DS18B20 sensors using Arduino Mega 2560. If any one of them go above 50 deg. celsius, then it sets the output pin to HIGH.
I am trying to run ...
1
vote
3
answers
76
views
Separate from Serial for digitalWrite()
This is my current code (Arduino Mega 2560):
#define p1 2
#define p2 3
void setup() {
pinMode(p1, OUTPUT);
pinMode(p2, OUTPUT);
Serial.println("ARDUINO : CONNECTED");
}
void loop() {
...
1
vote
1
answer
596
views
Can't install to arduino mega 2560 using arduino-cli, but can using IDE
I have a MKS GEN L v1.0 3dprinter board that works fine uploading using the IDE. But I need to install to it using the arduino-cli.
For some reason, the command arduino-cli board list says that the ...
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
2
answers
83
views
Why does analogRead(A0) deliver different Values when called in a library file vs calling it in the sketch directly
I wanted to write a library representing a sensor to later on have an array of sensors.
I generated a file MoistureSensor.h:
#ifndef MoistureSensor_h
#define MoistureSensor_h
#include <Arduino.h&...
3
votes
1
answer
520
views
Serial plotting a pwm
I'm trying to plot the value of the pwm that increases (every 2 sec) then decreases to compare it to the value of an encoder. I was expecting a continued value (like a step ) during 2 seconds but ...
1
vote
0
answers
59
views
slave arduino receiving commands from two serials
I have a slave arduino connected to a master arduino mega (through UART) and to a RPi (through USB). The slave arduino is set to monitor various SHT85 (through I2C) and NTC sensors. What I would like ...
0
votes
2
answers
131
views
Pin outping 1V instead of expected 5V, not hardware related
Heyo everyone !
I'm in a project where I need to send a signal if I detect vaccuum.
I'm sending the signal on PIN 9 but I soon realized that I was only getting 1V.
Tought I was alternating between ...
1
vote
0
answers
77
views
Arduino MEGA crashes with Ethernet shield to connect to two TCP servers
I have Arduino MEGA with Ethernet Shield and a SD card connected to a RUT950 GSM router. Then, I also have two sensors connected to the router and they run a TCP server that sends measurements ...
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 ...
1
vote
0
answers
206
views
Error with Mega2560 via SPI
I tried the following code to communicate via SPI with MPU9250 and Mega2560 But I got the following error:
Error initializing communication with IMU
Why I got this error?
/*
* Brian R Taylor
* brian....
1
vote
0
answers
250
views
Stepper motor not working with A4988 driver
I have been trying to run stepper motor via Arduino Uno and A4988 motor driver via this tutorial: https://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-...
1
vote
0
answers
74
views
Cannot connect Arduino Mega 2560
I was able to work with the same Arduino on the same laptop yesterday. However, the Arduino IDE is unable to connect the Arduino Mega 2560 today. I tried with a different Arduino Mega 2560 but the ...