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.

Filter by
Sorted by
Tagged with
2 votes
4 answers
379 views

Need some Hardware advice with arduino

I am fairly new(having less hands on experience) to Arduino and electronics in general. I have a project for which I know the features and required electromechanical parts. I need some advice in ...
user50927's user avatar
2 votes
4 answers
7k views

How do I properly receive MIDI with Arduino, with 6n138?

UPDATE : I still can't receive MIDI as of 2019/07/01. Here goes so far : I'm trying to follow this schematics from instructables, using 6N138. To make it easier, I'm going to copy his schematics. =...
Rinaldo Jonathan's user avatar
2 votes
2 answers
25k views

String to char array conversion

In my project I need to convert a string to a char array. From various examples I concluded that toCharArray() will convert a string to a char array. But I failed to do so. The error is: 'a' does ...
Tanmay Yerunkar's user avatar
2 votes
2 answers
1k views

Hacking old car dvd monitors with arduino

I got this old junk LCD from my car. The DVD function stopped and the LCD holder on the top of the car broke, so I took it. Is there any documentation or advice I could use to get this working with ...
Dylan Turner's user avatar
2 votes
4 answers
2k 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 Ω resistor from 5V to Reset, and 10 µf capacitor form reset to GND (to disable autoreset), and the variables still seem ...
nbenz's user avatar
  • 23
2 votes
2 answers
9k views

Is ATMEGA328P the same as 16U2?

I've been playing with my Arduino for a few months. But, I just bought a shield that says it needs to be used with ATMEGA328P. My box says I have a 328P, however, reading the chip, it's inscribed ...
PlayswDuinos's user avatar
2 votes
4 answers
17k views

How to wire up 4-digit 7-segment display?

I have an Arduino Mega and the CL5642BH, a 4-digit 7-segment display. I found very helpful code here, but I don't understand how to wire it up on the breadboard. The display has 12 pins: 6 on the top ...
bytecode77's user avatar
2 votes
2 answers
14k views

what is fastest allowable serial baudrate?

what is the fastest serial read the Mega can do? begin.Serial1(1024000) is accepted for compiling, but reading jibberish any suggestions on a faster device?
Tim's user avatar
  • 21
2 votes
1 answer
247 views

Should a delay be expected to cause deadlock?

I have made a simple program using the int main() {} function. It has a delay in it. It is evident the code before the delay is running, but the delay never seems to time out and let the next ...
J Collins's user avatar
  • 295
2 votes
2 answers
131 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 ...
Aeva's user avatar
  • 23
2 votes
4 answers
242 views

What would be the best way of dynamically 'change' instances regarding dynamic memory?

Since I'm very used to object oriented programming, I would like to use this into my design. My application will have 4 led strips and each led strip will have a 'pattern' running on it. For this I ...
Michel Keijzers's user avatar
2 votes
5 answers
216 views

How to remove Arduino Due and Mega shields without bending pins?

What's your suggested technique for reliably removing Arduino Due and Mega shields while minimizing the chance of bending the strip header pins? For example, there's a similar discussion here where ...
RowanP's user avatar
  • 871
2 votes
2 answers
82 views

Why is my Arduino still working?

I read an article that said that shorting an IO pin to ground would destroy the pin. I've done this before when I connected a buzzer to an IO pin and to ground without resistors, the buzzer is only ...
Rhezner's user avatar
  • 21
2 votes
2 answers
853 views

Using more than 8 digits using the sevseg library

I am using sevseg and i can't get more than 8 digits to work. I really need 15. Does somebody know what I can do to get this? Shown is the original example This is using Gabriel Staples example in ...
klarson18's user avatar
2 votes
2 answers
6k views

How much numerical precision can the ESP8266 achieve?

Background: I am trying to port this solar tracker code by Gabriel Miller to run on the ESP8266. Now I'm not a particularly great coder, but I'd like to give it an honest try. As of recently, the ...
Boloar's user avatar
  • 25
2 votes
2 answers
9k views

Why is my interrupt code not working?

Background I'm trying to write code to read signals from a six-channel RC receiver on an Arduino Mega 2560. Currently I am keeping the code to just read one channel to make things easy to troubleshoot....
Ozymandias's user avatar
2 votes
1 answer
882 views

ATMega4809 via Nano Every marked as 20Mhz, but does this confirm it is actually at 16Mhz?

If you go to the official Arduino Nano Every page and click the Tech Specs tab, you'll see that it lists it as running at 20Mhz. Turn On Verbose Compile However, if you go into the Arduino IDE and go ...
raddevus's user avatar
  • 402
2 votes
1 answer
808 views

Convert float to byte, from Arduino to Raspberry Pi i2c

I'm trying to send the temperature value from the DHT sensor to a raspberry pi through I2C. Which is the best way to do it?. The temp value is a float, and I think I have to convert it to byte and ...
Guille's user avatar
  • 123
2 votes
2 answers
279 views

How many connections can Arduino I2C method create?

I was just learning about I2C between 2 Arduinos, one as sender and another as a receiver So I have got curiosity to know how many Arduinos can be connected to I2C connection in serial? I mean, ...
Subha Jeet Sikdar's user avatar
2 votes
1 answer
388 views

Wrong conversion of time_t to char

I have a simple sample of code that i want to convent a time_t to char array in order to concatenate it after, in an other array. Code: time_t unixt; char exm [40]; unixt = RTC.get(); Serial.println(...
billyVal's user avatar
2 votes
4 answers
25k views

Using analog in to read a push button

I'm working on a project in which I use a lot of the pins on the Arduino; I have run out of most of the pins and and I need to read the value of a push button. Is it possible to read the value of ...
Jacob Caldwell's user avatar
2 votes
1 answer
9k views

How can you reduce the clock frequency of an Arduino Mega?

I'm trying to debug a problem and need to reduce the speed of the clock on my Arduino Mega from 16MHz to 8MHz. I can't find any simple way of doing so, so I wanted to know if there were any gurus ...
Isabel Alphonse's user avatar
2 votes
2 answers
302 views

Why is there already text in the serial monitor before the Arduino initializes?

I have encountered this several times before and I would like it if someone was able to give an explanation. In almost any sketch that I've ever created with Serial communication involved, I notice ...
Sebastian Freeman's user avatar
2 votes
2 answers
1k views

Arduino PWM Pins Interrupt

I am creating pwm from an arduino pin with 50% duty cycle. I just want to know how can i detect its every falling edge using timer interrupt? I don't want to connect that PWM pin to an external ...
Waseem Usman's user avatar
2 votes
4 answers
6k views

How to use Multiple MPU9250 to Arduino Lilypad [duplicate]

Is it possible to connect more than one or to be specific 5 MPU9250 into 1 Arduino lilypad? How will I set the addresses, and where should I put the pins for SDA and SCL? I hope someone out there ...
Thomas's user avatar
  • 123
2 votes
5 answers
12k views

Logic level converter 12v to 5v

What is the cheapest and best method to convert 12v(14)<->5V(3.3)? Need to connect Arduino to a car. I need logical shifter not buck converter to connect Arduino to car 12v circuit. I would like ...
Kvach's user avatar
  • 321
2 votes
2 answers
111 views

Are there any Analog pins on the mega that can not be used as Digital?

I am using both Arduino nano and Arduino mega boards in my projects. I got a nasty surprise the other day when I learned that, on the nano, Analog pins 6 and 7 can not be used as digital pins. Are ...
Hoytman's user avatar
  • 747
2 votes
3 answers
10k views

Use RFID-RC522 with other Pins

I'm wondering where the pin setting is manifested in the library. I want to use the RC522 with other digital pins than the default 50-53 pins, because I am using a shield for a display on theese ports....
Joel's user avatar
  • 185
2 votes
5 answers
4k views

Prevent Arduino Mega from setting all Outputs to HIGH on Reset

The Arduino Mega 2560 Rev 3 has multiple relays connected to its digital output pins. Whenever the Arduino is reset (using reset button, turning on Serial Monitor etc), the Arduino turns on all ...
Nyxynyx's user avatar
  • 1,389
2 votes
2 answers
79 views

strange strings

#include "Keypad.h" char Incoming_value = 0; String password = "123456"; String input = ""; const byte ROWS = 4; //four rows const byte COLS = 4; //three columns char ...
Nader Abd Alhamed's user avatar
2 votes
2 answers
313 views

How to split 12V power suply to arduino and led matrix panel

I'm trying to build my Arduino project with Arduino mega and led matrix panel. I'm wondering what power supply should I buy, my first thought was to power the matrix panel from a 5v Arduino pin, but I ...
krystof18's user avatar
  • 315
2 votes
1 answer
1k views

Inaccurate and non-precise voltage reading from Arduino Analog pin

float get_volt() { rawVolt = analogRead(voltageSensor); vOUT = (rawVolt * 4.6) / 1024.0; vIN = vOUT / (R2/(R1+R2)); //if(vIN>12.0){vIN=12;} //if(vIN<11.12){vIN=11.12;} //return (vIN -...
Aditya Singh's user avatar
2 votes
2 answers
6k views

Arduino Mega - Multithreaded (run two loops simultaneously) [closed]

I am new to Arduino and I am not sure about how to get two loops run parallel to each other. I have tested the individual loops and both of them work perfectly before I combined them together. One ...
Brongzzz's user avatar
2 votes
1 answer
57 views

Why is one part of my code being executed over the part before it?

The following code doesn't behave the way I would like it to. Inside the loop function im measuring the distance in front of the robot and if it is less than 15cm than the robot should move back and ...
Don Grey's user avatar
2 votes
3 answers
582 views

How to multiplex multiple displays?

I want to use 2 "displays" with 4 digits. The displays are common cathodes with cathode transistors connected to the digits, as the figure: The segments of both displays are connected together on the ...
Alecrim's user avatar
  • 31
2 votes
2 answers
513 views

Object Array using Inheritance

I would like to create an array of a generic type so I can use multiple sensors and make my code as extensible as possible. /* Planning for good design. Agent library should be able to use more ...
Sam Hammamy's user avatar
2 votes
2 answers
7k views

ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function

This question comes on the heels of this question In the last question I learned how to use an initializer list to solve my issue, but working with ros::Subscriber is requiring a different solution. I'...
Jacksonkr's user avatar
  • 327
2 votes
1 answer
1k views

Arduino Uno Multiple Modules

I have an Arduino Uno and I want to connect; RFID Reader (RC522) WiFi Module (ESP8266 ESP-01) SD Card Module RTC (Real Time Clock - DS1307) Same time but pinouts are not enough. Is there a way to ...
ahmetertem's user avatar
2 votes
1 answer
565 views

Why does enabling TIMSK1 mess up serial?

I am intending to write a code where a user will send lines through serial to affect timer interrupts. I am noticing a problem with serial where as soon as I enable the timer interrupts, the serial ...
Sebastian Freeman's user avatar
2 votes
2 answers
774 views

Why PJ0 and PJ1 are not reporting as PCINT pins

When the sketch shown at end-of-question is compiled and uploaded to an Arduino board, it is supposed to Serial-print a list of available digital pins, showing for each pin whether it supports PWM or ...
James Waldby - jwpat7's user avatar
2 votes
1 answer
576 views

Are these lcd and motor-shields stackable?

first of all, I'm kindly apologizing for asking such stupid questions, but as my electronic-knowledge is dramatically limited, you are my only hope to get my problem solved. I'm pretty new to Arduino ...
irie's user avatar
  • 123
2 votes
1 answer
109 views

Why is sensitivity (threshold) parameter ignored

Analog pontentiometer connected to an Arduino. simplest possible setup. The goal is to send a message over Serial whenever the value changes. I do not want to spam the Serial connection to much, so ...
David's user avatar
  • 125
2 votes
1 answer
700 views

Nema 17 stepper motor speed problem

This code is quoted from here. May I know how to increase the speed of the NEMA 17 stepper motor further? I tried to increase the step speed to 2000rpm but it does not even work. It only works for ...
felix tan's user avatar
2 votes
2 answers
243 views

Update the ESP to espduino via NodeMCU Flasher

I am using Cactus Micro Rev2 and I'm trying to communicate with ESP via Mega32U4. I guess I have to update to espduino to be able to program the ESP side. And I don't know current ESP firmware version....
samedbll's user avatar
2 votes
1 answer
119 views

I want a bar type display for my Arduino Project

I am trying to make a smart table project. But I have stumbled upon one problem, that is I don't know which display should I use. I need a display that has roughly aspect ratio of 2:1 but also has a ...
shafiyyah's user avatar
2 votes
1 answer
221 views

The analog read is not giving the correct waveform as that of an oscilloscope

I have code that fetches analog input values from terminals A0, A1 and A2 of an Arduino Mega 2560. When I plot the data, it does not give the desired waveform. The desired waveform is also measured ...
coder_but_not_smart's user avatar
2 votes
1 answer
162 views

if I add a .cpp file, Serial becomes unusable

I am using the mega 2560. When I just use .ino and .h files, if I use Serial, it works fine, without even using: #include <SoftwareSerial.h> However, when I add a .cpp file I start getting 2 ...
Bbit's user avatar
  • 123
2 votes
2 answers
155 views

Ensure board is always on the same port?

I want to make a VB.NET program to communicate over serial with the board, but I need to be sure it knows which port. Instead of programming in more advanced methods of verification, for this project ...
SYGMAH's user avatar
  • 29
2 votes
1 answer
1k views

Ardunio Mega/ATmega2560: Using Port F or K for both analog inputs and digital outputs

On an ATmega2560, can ports have some pins used for analog inputs but others as digtial i/o? Specifically, I only need to use 3-5 analog inputs but have many digital inputs. I would like to use the ...
Matthew's user avatar
  • 23
2 votes
1 answer
1k views

Ultrasonic sensor underwater calibration

Does anyone knows how to calibrate AJ-SR04M using the Arduino? I am working on AUV. underwater reading from current code; it is giving continuous 20cm while moving inches. http://shop2.hanjindata1....
Khurram Jafry's user avatar

1
3 4
5
6 7
37