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.

learn more… | top users | synonyms (1)

0
votes
1answer
28 views

Trying to read analog signal with digital pin using outside ADC

Is there a way to route an analog signal from a simple temperature sensor through an ADC, MCP3008, into a digital pin. I have used all the analog pins on my Arduino Mega 2560 and am trying to utilize ...
1
vote
1answer
32 views

FreeRTOS: Object not created properly from within task

I am encountering a very strange error using freeRTOS on an Arduino Mega2560: In the setup block I can create an instance of my class: MyClass* myClass = new MyClass(/*char*/ a, /*char*/ b, new ...
1
vote
2answers
56 views

Controlling 5 DC motors with Arduino

I am looking to purchase the correct hardware to be able to control 5 DC Motors from an Arduino (UNO preferred, MEGA if necessary). The Specs of the Motors are as follows: 12 V nominal, 3 → 12 V dc, ...
2
votes
2answers
73 views

Using a lot of interrupts on a single Arduino

I'm doing a little project that requires a lot of sensors. Right now I'm using 4, but i want to reach up to 60 sensors, and a minimum of 16 (for me that's a lot). So, I have an Arduino MEGA 2560, and ...
1
vote
0answers
20 views

DHT22: Library and Data accuracy

I am using DHT22 temperature/humidity sensor and I noticed that there exist so many libraries. I wonder which one is the most accurate? It is giving me readings that does not seem to be logic. High ...
1
vote
4answers
204 views

Is there any way I can stop the Arduino Mega 2560 from resetting all variables after losing and reconnecting power?

I am using an Arduino Mega 2560 board. I have tried connecting a 115 Ohm resistor from 5V to reset, and 10Uf capacitor form reset to GNd (to disable autoreset), and the variables still seem to reset ...
0
votes
0answers
32 views

Arduino error: Bad File Descriptor

So I just downloaded Arduino IDE on my Linux laptop. I also have an Arduino mega 2560. With nothing connected to it, I tried to upload the blink sketch to test if it is working. However, I get this ...
1
vote
2answers
75 views

Why does the same block of code act differently in different sketches?

I am building a robot with multiple sensors, abilities etc. Since I had a bug with a HC-SR04 rotated by a servo, I experimented in a different sketch. If the distance is less than 30cm, the servo ...
0
votes
2answers
21 views

Interrupt driven serial in Arduino Mega

This is the multi serial example from Arduino IDE void setup() { // initialize both serial ports: Serial.begin(9600); Serial1.begin(9600); } void loop() { // read from port 1, send to port 0:...
0
votes
1answer
17 views

Perform function after a period of time

I am working on a project that I am supplying with voltage an LED through a digital pin (26) and I want the LED to be switched off after 4 seconds. I am using Arduino Mega2560 and I am programming it ...
0
votes
1answer
14 views

arduino mega_lcd

.i am doing lcd interfaced with arduino.Sometimes it happens it shows nothing after uploading the program.what to do?
0
votes
1answer
11 views

Pin 0 (62) you are trying to use is not supporting interrupts

Using RCLib (github) I'm getting this error. The trick is that the RCLib example works on it's own but does not work in my program (github). Serial Output "Error" Pin 0 (62) you are trying to use is ...
1
vote
1answer
69 views

How come my code does not wait for a specific time before going into an if statement?

I have an HC-SR04 attached to a servo. When the 90 degree reading is less than 30 cm, I want the motor to take 2 seconds to turn to 130 degrees, get a measurement on the right, and turn back to 90 ...
0
votes
0answers
35 views

Why is my Arduino printing memory addresses to serial?

My sketch has a number of things in it, including "booting up" and "HERE" (for old-school debugging). My sketch works everytime on my Uno but maybe 1/10 on my knockoff Mega 2560. I'm currently trying ...
0
votes
0answers
17 views

digitalRead acting weirdly [duplicate]

I wanted to make a program, which would be started by you hitting a button, so in a loop I programmed: if (digitalRead (50)) { Serial.println ("hi"); } Where now Serial.println ("hi"); would be ...
0
votes
1answer
12 views

SIM900 random shutdowns

I have a SIM900 GPRS/GSM Shield and an Arduino Mega. Now for the past week I have been using USB as power to send and receive GPRS data with no issue. Today the SIM900 module is continually randomly ...
0
votes
1answer
22 views

Serial characters are corrupted

I try to send an "a" string via serial with Serial.println("a"); and I receive "Oy=" in Ascii or {4F}{79}{3D} in Hexa. Where should I start investigating? What could be wrong? Baudrate is 9600 on ...
2
votes
0answers
62 views

Arduino program does not start when plugged in

I am having trouble with my Arduino Mega with getting the program to start when the Arduino is plugged into a computer via USB. All that happens is the LED turns on and stays on. The device does not ...
0
votes
1answer
25 views

DMX dimmer appears to receive data from Arduino but connected lights do not respond

I'm trying to control a DMX dimmer (eurolite ES-12 IEC DMX Switchback) through an Arduino Mega. In an earlier test, we were able to make one RGB DMX light run through the color spectrum. Now, a ...
1
vote
1answer
23 views

Receiving live astronomical coordinates on Arduino Mega using telnet and ESP8266 wifi module

I'd like to receive on my arduino live coordinates of planets of solar system. Because there are already websites listing every planet coordinates, I thought it would be easier to just use a wifi ...
0
votes
0answers
38 views

xxx.cpp error: 'xxx' does not name a type

I've written my first small Arduino Library and have tried to use it. It is basically just a Class to store some data in an organized way. When I use it, I get this compiler error in the IDE: \...
0
votes
1answer
20 views

EPS8266 ESP-01 Blue led stays lit unless 3.3v logic divider is bypassed, works when reconnected

I am having a very weird and frustrating issue with this ESP01. I am creating a shield on protoboard, and everything checks out as far as I can tell. I am using a 3.3v voltage divider (1k and 2.2k) ...
0
votes
1answer
16 views

SIM900 TCP Connection issue

I am having a strange issue where if I try and create a TCP connection to my service, it doesn't work. But any other website, such as google, works fine. The serial monitor output is also slightly ...
1
vote
1answer
14 views

Connect to Arduino 2560 using a RS232 Connection

Is it possible to connect to an Arduino 2560 using a RS232 (DB9) connection rather than the regular connection using USB cable? I am thinking of this connection scheme: PC -> USB cable -> USB ...
0
votes
1answer
17 views

Arduino 2560 as an Interface to 4 Serial Hardwares

I am writing a software that runs on the PC that has a Arduino 2560 connected to it via USB. This PC needs to communicate with multiple devices through RS232. Is it possible to use the Arduino's 4 ...
0
votes
1answer
16 views

Arduino Mega 2560 Only Powers on with USB

I have an Arduino Mega 2560 board running a ramps 1.4 shield for a 3D printer. For some reason, I can only power the Mega with USB. It does not get power from the ramps shield and it also will not ...
0
votes
1answer
61 views

ESP 8266 does not respond for any

I have ESP 8266 Wifi module and Arduino mega Board connected. I use external 5 to 3.3v regulator to power up the module.and mu common (-ve) line on the external power source and Arduino mega GND is ...
0
votes
1answer
36 views

How do I read numbers from a serial sequence

I have read through a number of posts including How do I split an incoming string? However I cannot work out how to extract numbers from a serial string. My challenge is this; I send a serial ...
-1
votes
1answer
39 views

Steppermotor+Arduino Mega+ Adafruit

I have 2 Stepper Motors (QMot stepper motor1 Amp, 5.3Ohms, 5.3 volts and 200 steps/rev.) , which are connected to the Adafruit shield2.4, they are mounted to Arduino Mega, the motors pull generally 2 ...
0
votes
1answer
36 views

Arduino - RF 433 Mhz transmitting string and but receiving ASCII values of those characters

When I am using RF 433 MHz module with ARDUINO MEGA then it is transmitting any text or anything in ASCII values. Now how to decode those ASCII values to alphabets? If I use ASCII conversion programme ...
0
votes
1answer
21 views

Why does my servo execute an action in the beginning when the odds are almost 0?

I made a servo motor turn if the result of random(0, 10000) is less than or equal to 1. If that is the case, the motor turns to 130 degrees, to 50 degrees, and then to default position(90 degrees). It ...
0
votes
1answer
23 views

do i need an I/O shield for quadcopter motors

I would like to know if I need an I/O shield for the 4 ESC's on a Quadcopter I am building using Arduino Mega2560. The current to the ESC's should come from the battery itself and the data from the ...
0
votes
0answers
22 views

Arduino Serial Communication Fast Protocol

I am sending data to Arduino from Raspberry PI using USB Serial communication at 115200 baudrate to run two stepper motors in real time.Protocol defined is of format < motor1Angle,motor2Angle >....
0
votes
1answer
20 views

Cannot open file with underscores using the SD library

So I'm trying to create a new file that has underscores in its name. However, when I try this, no file is created. This works String fileName = "NMEA.txt"; mySensorData = SD.open(fileName.c_str(), ...
0
votes
1answer
45 views

How can I make a servo turn an ultrasonic sensor without using delays?

I am making a RC robot that will have multiple sensors and will display the data on an lcd screen. It will also have a mode where it will avoid obstacles, using an HC-SR04. When the sensor is within ...
0
votes
1answer
35 views

Interfacing to scale over RS-232

Objective: interface and Arduino MEGA to a Mettler Toledo SB32001 using the RS-232 communication protocol described in the manual. Equipment Used: SB32001 Mettler Toledo 32 kg scale Arduino MEGA ...
0
votes
0answers
80 views

SIM808 module : GSM location command (AT+CIPGSMLOC=1,1) giving wrong value after execution of sending message command(AT+CMGS=+91xxxxxxxx)

I wrote the code that if interrupt generated, get gsm location and send a message. first time interrupt generated, got correct gsm location using (AT+CIPGSMLOC=1,1) and successfully send message ...
0
votes
1answer
21 views

How to use Aiduino module to connect to computer network?

I have 4 usb Hard Drives and I just want to connect them to computer network directly without a traditional computer. Is there an any module with 4 usb ports and one RJ45 port. The module should able ...
1
vote
1answer
22 views

How to detect cancelled download?

I have a server with files that may be downloaded. How do I go about detecting when a download is cancelled by a client? The function that handles reading files for download: void readFile() { ...
0
votes
1answer
52 views

Custom ATMega 2560 board won't execute Arduino code

I have a custom PCB with an ATMega 2560 microcontroller on it. To test if the ATMega was working properly, I uploaded the following code: void setup() { Serial.begin(9600); Serial.println("Test ...
0
votes
1answer
25 views

Getting "Undefined reference to vtable for {classname}

I have a large collection of libraries that compile correctly but won't link. I am using Visual Micro for Visual Studio 2015. Here is the complete collection of error messages: CommandPattern3.cpp.o:...
0
votes
1answer
33 views

Should I control each of the four robot wheel separately or wire two from each side together?

I am making a remote controlled Arduino robot. I has 4 DC motors for wheels. I have 2 motor drivers available that control two dc motors each. I was wondering what the downsides are of wiring 2 dc ...
0
votes
1answer
38 views

Engine Speed Control Observation

I am using an Arduino Mega to control the speed of an internal combustion engine. The speed is sensed via a Variable Reluctance Sensor (VRS) on the crankshaft. This signal is then converted into a 5V ...
2
votes
2answers
52 views

How to get readings on serial monitor in every 10s?

I am doing my final year project and here I am attaching the code I am using. According to the code, I will get the sensor output in serial monitor. But I want to get reading once n 10ms. Since serial ...
0
votes
1answer
45 views

Is it possible to use a usb camera with Arduino?

It is necessary to recognize the motion and record video live. upd Save enough on your memory card. PS Maybe I'll repeat the question, but I am not guided in English. Sorry for my English.
0
votes
1answer
21 views

SD test is taking long answer when it fails

I am working on an Arduino application that logs sensors values into SD files. It is essential that the SD is inserted and working when a test is started, thus I need to check the presence of the SD ...
0
votes
1answer
49 views

Why does Serial.print print out the wrong thing?

I am using a flame sensor. I am reading the state and then printing it. Here is my code: void loop(){ flameState = digitalRead(flamePin);//variables already defined and are global existsFire();//...
0
votes
1answer
46 views

Why does servo library conflict with irremote?

I am building an Arduino Mega robot. I am planning to use IRremote.h library for it. I am using multiple libraries in my code and I do not know which timers are taken. I always get errors when ...
0
votes
0answers
27 views

For statement break problem

I'm trying to make a timer but running into a problem. The seconds segment is working fine, however in the minuets segment I have a problem. I've currently got a commented out break to stop it ...
0
votes
0answers
29 views

Ardupilot APM 3.1 to run DC motors using motorshield

I am working on APM 3.1 to make an autonomous vehicle. I checked on net most of people are using brush-less motors with esc which I know how to connect to APM and r/c receiver. I want to use separate ...