Questions tagged [atmega2560]

Low-power 8-bit AVR microcontroller with 256kB flash.

Filter by
Sorted by
Tagged with
2
votes
1answer
121 views

How to wake up Arduino with an rtc?

I am doing a data logger with an Arduino Mega2560 and I want to use a code to make it sleep when no measure is needed and wake it up with an RTC when time comes. The reason I want this is because I ...
0
votes
1answer
2k views

How to program the Robotdyn Mega 2560 PRO MINI?

I want to program the Robotdyn Mega 2560 PRO MINI which has no USB port. How do I connect the pins to an FTDI? Which setting do I have to use in the Arduino IDE?
-1
votes
1answer
33 views

library for BME280 temperature and humidity sensor using Software I2C [closed]

I need to connect multiple i2c sensors to the Arduino, and for another sensor that i am using i need to use the software I2C library. i was wondering if anyone has a library for the bme280 sensor to ...
0
votes
2answers
34 views

Am not able to call C++ function pointers from inline assembly

Due to some curiosity, I was trying to use some assembly with my Arduino MEGA 2560. I am not able to invoke a function from a c++ function pointer array. When I uncomment the call function, func_a ...
0
votes
2answers
142 views

Is an atmega 2560 board compatible with the Adafruit Trellis?

I want to build a custom midi controller for my computer, and yes, Adafruit has a mini Untz project. For my purposes, I need more analog inputs than the Leonardo, and the only other option I can find ...
0
votes
1answer
29 views

Activating a defined macro in a class from main.cpp

Sorry if this question been asked. I'm trying to activate certain function in a class using a macro defined in the class from main.cpp. I'm using jrowberg MPU6050 library if that matters. main.cpp #...
0
votes
1answer
65 views

What are the negative PINs for on the IndustrialShield M-Duino 58 Analog

I am working as an internship on an Arduino based PLC. It is the M-Duino 58 Analog from IndustrialShields. I try to figure out how it works; Reverse Engineering. But i dont know why it has negative ...
0
votes
2answers
17 views

DHT11 and Liquidcrystal setting cursor issue

lcd_key = read_LCD_buttons(); float temp = dht.readTemperature(); delay(1000); // lcd.setCursor(0,0); if(temp < 0) { lcd.print(temp); } if(temp >= 0.00 || temp <= 5.00) { lcd....
0
votes
0answers
11 views

I am trying to rewrite an RFID with a MEGA2560 and a RFID-RC522

I have been trying to rewrite an RFID tag so it is the same as my other one. I have code that will read both separately but I cannot find any already written for the MEGA2560 that will work for me. ...
2
votes
1answer
45 views

Servo motor troubles

The image is as clear as I can make it. Here are the basics of my problem. My program is meant to make 6 red LED lights in sequence fade in and out, toggle 5 white LED's on and off with a button, and ...
0
votes
1answer
189 views

Adafruit Micro-SD breakout not initializing on MEGA 2560

] [I am having quite a bit of trouble trying to get my Arduino MEGA 2560 to read my micro-SD card. My wiring is as follows: Breakout Arduino 5v 5v Gnd Gnd CLK 52 DO ...
0
votes
1answer
2k views

Disable auto-reset Mega 2560 on serial monitor open using 60 ohm resistor

I tried preventing my Arduino Mega 2560 from restarting every time I open the serial monitor. This link didn't work for me at all. I tried connecting the RESET pin to 3.3v pin via a 60 ohm resistor ...
0
votes
1answer
30 views

Passing struct from main.cpp to a class

Sorry if this question been posted but I couldn't find the one that matches my issue. I couldn't pass my struct values from the main file to a class. Any ideas? I got this: error: no matching ...
0
votes
1answer
38 views

Velleman KA02 not working on Mega 2560 r3

I have a Velleman KA02 audio shield. When I use this shield on an Arduino UNO R3 with this sample code, it works. And by "work" I mean when I interact with the Serial Monitor (by pressing Y, for ...
0
votes
0answers
49 views

Problem with I2C

I trying to make a project to write and i2c display from a renault megane vehicle. There is many people showing it but there is no code that i can use. So i buy a cheap analyzer and i can clearly see ...
0
votes
0answers
34 views

Using SMS to receive password, then to choose whether to turn the relay on or off

I'm trying to use SMS messages to turn a relay on/off but before doing that i need to have a password system before allowing the user to turn the relay on/off. Basically, you have to send the password ...
0
votes
1answer
59 views

How can I make a Parallax Servomotor move a water tap correctly and prevent from vibrations?

I am using Arduino Mega 2560 I have built an structure with plastic 3D pieces to move this water tap.: I am using the "Servomotor Parallax Inc 140 mA, 4 6 V" to rotate the tap: Some more images to ...
2
votes
2answers
3k views

Arduino crashing during serial print for no obvious reason

I've written some Arduino Code which kept crashing and i couldn't find out why. Then i reduced the code as much as i could in order to see the problem. The reduced code currently doesn't do anything ...
2
votes
2answers
84 views

Arduino Uno lag in simple loop

I have a simple Arduino sketch which I have been playing with on my Uno. The idea is simple, the user turns a potentiate (pin A2), when they pass a certain threshold a LED is turned on (pin 7). Here ...
0
votes
2answers
52 views

Is possible use Macro F() with Integer and Other types of variable?

i have a sketch that is using very memory RAM of my Atmega2560 (is a giant project), and i need use various "println" because i have a TFT screen and i need to show data on the screen to user see. So, ...
0
votes
2answers
62 views

Will bootloader communicate via TX0 / RX0

I'm fairly new to Arduino programming but have a good deal of experience with low-level programming early processors, having originally cut my teeth on Z80, 8088, etc. I'm looking at developing a ...
0
votes
2answers
37 views

what will be the sampling frequecy of my arduino Mega 2560 code. How would I calculate it?

void setup() { // initialize the serial communication: Serial.begin(9600); pinMode(10, INPUT); // Setup for leads off detection LO + pinMode(11, INPUT); // Setup for leads off ...
0
votes
1answer
83 views

C++ State Machine / Wpmf-convesion

I'm quite a newbie using C ++. I am trying to implement in C ++, the state machine described in this link for C language: https://barrgroup.com/Embedded-Systems/How-To/Coding-State-Machines. I have ...
-1
votes
3answers
611 views

avrdude flash issues

I want to burn a hex file to a custom ATmega2560 board. I use this USBasp programmer for flashing (firmware version 1.01) on my Mac OS X 10.12.6 system. All hex files are compiled with avr-gcc (GCC) 4....
0
votes
1answer
101 views

ADC register always returning high

Regardless of whatever voltage at A0, the software is always returning high (1023) volatile unsigned char* ADmux = (unsigned char*) 0x7C; volatile unsigned char* ADCSRa = (unsigned char*) 0x7A; ...
0
votes
0answers
62 views

Arduino code does not function when relays are powered

I have a mega arduino, which is supposed to to power 4 relays using 4 touch sensors TTP 223, the relays are 5V coil and 220V. the arduino is powered by a 5 V adapter "mobile phone charger" and it ...
2
votes
1answer
133 views

I2C communication between arduino and raspberry pi breaks under stress for unclear reasons. Why?

I am having a behavior I cannot explain while using arduino mega as a I2C slave for a raspberry pi master. I am showing here an idealised program that shows the issue. I experience pretty much the ...
0
votes
0answers
17 views

An Error while uploading the sketch [duplicate]

I am getting the error, unable to fix it. I have Arduino mega2560 board which is showing the error. and also When connected both the LED's are continuously in ON. But it is showing in device manager ...
0
votes
1answer
62 views

Floating power supply for Arduino - Is it still connected to the USB ground?

I am trying to power my Arduino Mega 2560 from a benchtop power supply. I plan to essentially feed in a 9V supply directly on the Vin pin and connect the GND pin to the floating ground pin on the ...
1
vote
0answers
91 views

Advice needed for powering Multiple HX711 with Arduino Mega

I have a project where I need to use multiple load cells (6-8), with individual HX711 for each load cell, which need to be powered simultaneously. I am not sure if I can power all the HX711 with 5V ...
0
votes
1answer
57 views

Arduino Nano, Uno and Mega - XBee connection difference

I have a simple sketch working on arduino Uno and Nano sending data using an XBee. However, if I run the project on an Arduino Mega it does not work. What differences between Uno/Nano and the Mega ...
0
votes
1answer
37 views

Concern myself with current draw from digital pins used as INPUT with internal pullups?

My project is using a genuine Arduino Mega 2560, probably 3-4 yrs old since purchased (I don't see any revision numbers on the PCB). It's being used to read a lot of switches, buttons and drive some ...
1
vote
1answer
137 views

How to count the number of rising edges on DS3231 rtc?

I am using a DS3231 rtc and I would like to get millisecond accuracy from it so I decided to use the 32kHz generated clock from it. I wrote a code that would count the rising edges or falling edges ...
0
votes
1answer
52 views

Why is Serial Print causing different behaviour based on where its located

Im trying to test out these two motors I have where I need to call a function from the loop. I only want to call this function once so I made a quick little if statement to have the program only run ...
1
vote
1answer
99 views

Set PWM by period? And have it variable?

In this other stack QA I'm asking about generating a pulse signal with a period ranging from 63 ms to 6.5 ms. There is a popular PWM library however it doesn't compile and also since 63 ...
1
vote
0answers
111 views

Arduino not responding while trying to flash over BLE

I'm working on wireless uploader for Arduino from iOS devices. I'm using HM-10 BLE module which seems to work ok. PIO 2 is used as DTR for resetting (see A [0x41] T [0x54] + [0x2B] P [0x50] I [0x49] O ...
1
vote
0answers
215 views

Intermittent wifi/hotspot connection

I have an Arduino Mega 2560 with a cc3000 Wifi shield that is sending messages to dweet.io. Here is the relevant portion of my code: // Post data to dweetio char data[125]; sprintf(data, "?t1=...
0
votes
0answers
483 views

OneWire with DS18B20 digital sensor only works on the I2C (20 and 21) pins of my Mega?

I am using an Arduino Mega to read a DS18B20 temperature sensor using the OneWire library in the code below which I got here: #include <OneWire.h> #define DS18S20_Pin 20 //DS18S20 Signal pin ...
1
vote
1answer
36 views

Serial Port fails with speeds greater than 19200

In Arduino Mega 2560 R3, properly selecting the Serial Monitor bauds, this code works with #define R 38400, but for some reason, not with #define R 19200 (?), #define R 38400 int rate=R; ...
0
votes
1answer
89 views

Maximum sampling rate of Arduino Mega2560

I'd like to know what is the maximum sampling rate achievable while using ADC on Arduino Mega2560. Thanks
0
votes
2answers
219 views

mega2560- Interrupts reading digital input

Hi I am very new to Arduino, with very little programming experience. I am using mega 2560 and trying to understand how interrupt works. I have a code written, it is very similar as the example ...
1
vote
0answers
58 views

Is there an easy way to connect and control 3 servos?

I need to connect and control three Parallax Standard Servos to an Arduino board, and apart from the USB connection, nothing else will be connected to the board. My predecessor used a setup of and ...
1
vote
1answer
2k views

SOLVED: Strange phenomenon with avrdude: stk500v2_ReceiveMessage(): timeout only with ATmega250 on windows 7x64

I know this problem has been reported multiple times but in my case I think there is a different light on it. My desktop is a w7x64 box and I also have a notebook with w10. Both system have the ...
0
votes
3answers
304 views

Why Arduino Mega 2560 throw error when i try to upload example

I'm try to connect my Arduino Mega 2560 to PC, but I think it's not easy as I imagine. I spent a lot's of time to install USB driver. Here is a screenshot: When I try to upload blink example, Arduino ...
0
votes
0answers
51 views

Programming AFE4404 using Arduino mega2560

I'm facing difficulties programming an AFE4404 using the arduino mega2560. I'm using AFE4404 I2C to program it. I tried most of the code I found online with minor changes to get all the LED and ...
-1
votes
1answer
44 views

Controller freezes

I am using atmega 2560 as main(master) controller and other 5 salve 2 atmega 8 and 3 atmega 328p, there is two device with analogue output connected to main controller atmega 2560 through ads1115 ...
0
votes
0answers
52 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
1answer
122 views

How can i stop DC motor when button on remote is released? [closed]

I am trying to control a motor using a remote with Arduino Mega. The motor turns on when I press the button on the remote but when I release the button, it continues to move. Does anyone know how to ...
0
votes
1answer
215 views

Help understanding how avrdude works with ArduinoISP and why its not working for me

I am trying to use avrdude with a Mega2560 running ArduinoISP Note: I have the 10uF cap on the Mega2560 RESET line as described by Ardunio. Also, I am using avrdude/6.3 on Windows 10. The Mega2560(...
1
vote
0answers
88 views

Erasing all flash on boards with over 64kb of program memory

I'm using a Mega2560 board. My project needs to store some large constant data. To preserve the first 64kb flash chunk, I write these data on addresses beyond this limit. But there is either an ...