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.
0
votes
2answers
22 views
Can I use the same Data Registry for both input and output pins?
This is for a class in which we are not allowed to use the Arduino Library (Not my choice or preference). I know to use DDRB for the B pins. This is the code that I have so far:
//Global pointers
...
0
votes
1answer
22 views
Get pin input status without using the arduino library
I am not allowed to use the Arduino Library (or any Library) for this program. How would I check the input of a pin?
I found two different functions:
In Arduino.h:
#define bitRead(value, bit) (((...
0
votes
0answers
10 views
DC Motor Pinning the Ada Fruit Moto Shield with the Mega2560 R3
I picked up an AdaFruit Motor Shield V2.3 . The example on the site shows how to code the DC Motor connection
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS ...
1
vote
2answers
19 views
combination of arduino uno and mega?
I am new to Arduino. Can I combine Arduino UNO and MEGA in 1 project? Arduino UNO is for audio output and MEGA for LCD display. If I am wrong, is there any ideas how do combine both LCD display and ...
0
votes
1answer
21 views
How to read differential TTL signal from encoder using Arduino?
I am using Arduino UNO/ MEGA to read the incremental encoder pulses (Baumer encoder EIL580). Currently, I am using it in single-ended mode (reading A,B and Z outputs) as I am not sure how to read the ...
0
votes
0answers
9 views
Arduino Mega connection to Arduino GSM 2 shield
I'm about to purchase the Arduino GSM shield 2 and have a question about connecting the shield to an Arduino Mega. It says on the documentation that you need to reroute pin 2 to pin 10 so that it can ...
1
vote
1answer
36 views
Serial communication with Python
I am trying to send integer from my Python program to Arduino MEGA.
If I send 1, the LED should turn on and If I send 0 the LED should turn off.
I was able to write Python code correctly as I think. ...
1
vote
2answers
43 views
How to Factory reset ESP8266? [closed]
I want to use ESP8266 to send emails. I tried twice flashing the Firmware to a particular firmware as suggested in a tutorial. Now both my ESP are unresponsive to AT commands. Let me know the way to ...
-1
votes
0answers
29 views
problem in send/receive using Xbee with arduino MEGA
I want to send and receive data through XBee by using Arduino Mega with an XBee shield. The board is not receiving or sending anything.
I've tried it using:
1)
#include <SoftwareSerial.h>
...
2
votes
0answers
16 views
Attempt stacking 'CAN-BUS' and 'USB Host' Shields on Mega 2560
I've run into a case of 'In theory it works, but in reality'....
I'm using the CAN-BUS Shield V1.2 from Seeed studio. Many things are written in broken english, so I'm starting to wonder if I can ...
2
votes
2answers
22 views
Analog read negative voltage inbuilt protection
I'm trying to read a -10 to +10V analog signal on my Arduino Mega (2560). I've been using a voltage divider to obtain a -5V to +5V signal (with two 10kOhm resistors), which used to work just fine.
I'...
1
vote
2answers
30 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 ...
-1
votes
1answer
38 views
control multi adruino over the internet [closed]
I have three arduino in different locations (house 1, house 2, office) and I am trying to build a web application to control these arduino, what are the possible ways to distinguish between then over ...
2
votes
1answer
45 views
Using an LM339 IC as a motor driver
I have an LM339 IC from Radioshack that I am hoping to use as a motor driver.
I read many resources on how the L239D can be used as one. I don't have enough circuit experience to truly know the ...
1
vote
1answer
46 views
Individual control of multiple RGB leds
I'm trying to control several RGB leds individually. So far I've been able to control multiple RGB leds using only 3 PWM outputs using NPN transistors as shown here (pic below).
I would like to ...
0
votes
0answers
13 views
can't find Nexion libraries for arduino
I'm new to Nextion HMI and i try to import the Nextion libraries for arduino it didn't work as expected can any know any reference for download the Nextion libraries for arduino
-1
votes
0answers
18 views
How do I run 6 motors and sensers for a Arduino mega?
I am building a robot and don't have much knowledge in electrical components. I was wondering if the arduino mega could handle 6 motors (the motors specifications are located bellow). I also was ...
1
vote
1answer
30 views
Arduino Mega 2560 from .org- which IDE works?
My personal choice is to purchase from the .cc (or adafruit) for new boards. YMMV. Craigslist locally of course has generic and .org boards now and then.
If I get a .org board on craigslist, will I ...
1
vote
1answer
24 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 and initializer list to solve my issue, but working with ros::Subscriber is requiring a different solution.
...
0
votes
1answer
22 views
Problems with Ultrasonic Sensor
I want to check my understanding on how to use digitalWrite for 5V and Grd and why this code isn't working.
This is for the Makeblock sensor
Consider the image here which says to plugin a wire to 5V,...
-1
votes
2answers
26 views
Delay In receiving data when SoftPWMBegin(); is used from SoftPWM.h library
when i use SoftPWMBegin() function in setup there is some delay while receiving data over bluetooth. And if i pressed o and 1 fastly (see in below given code), some time it receives data and sometime ...
1
vote
1answer
20 views
Stepper motor shield compatibilty question
I recently bought Adafruit's motor shield v2 only to find out it can only support upto 12v.
So I'm on the look out for another shield & found this one
Arduino Dual L6470 Stepper Motor Shield
I ...
0
votes
1answer
46 views
9V Vin powered Mega - 3V instead of 5V
I'm experiencing an issue with an Arduino Mega 2560 :
I powered the board through the Vin using a +24 --> 9V voltage regulator. When I power the board and measure the 5V output from the board, the ...
1
vote
2answers
62 views
Unable to interface AD7705 (SPI) with Arduino
Code as shown below, I am unable to get the 16 bit data.
Can someone help me identify my mistake?
byte spiTransfer(volatile byte data) {
SPDR = data;
while (!(SPSR & _BV(SPIF)));
...
1
vote
1answer
40 views
I swear this worked yesterday!! - mysterious compiler error
I thought I finally had this working yesterday, the code compiled, and executed on the arduino, there were however some small quirks but today I went to fix a small timing issue, but got the following ...
0
votes
1answer
53 views
Code will not run when serial monitor is not open
I have never seen anything like this. My code runs perfectly as long as the serial port is open. However if I connect it to external power, or even if I just try to run it plugged into my computer ...
0
votes
0answers
13 views
Iqs316 proximity sensors using with Arduino?
Does anyone know how to use the iqs316 touch sensor using for Arduino? I only found the setup code for pic18. I don't know how to setup the iqs316 in Arduino. Please share with me if you know.
0
votes
1answer
23 views
Arduino code won't upload with Ethernet Shield attached
Been playing with my Arduino Boards for a while. i have an Arduino NANO UNO and a Duemilanove 328.
I've been able to program both of them no problem for weeks. Any example project I try will ...
-1
votes
1answer
61 views
Can I create a serial.read command with the arduino code alone?
I am trying to manipulate a project and the simplest way to do what I am trying to do would be to use the existing code. This code is designed to take an input from the serial monitor using serial....
0
votes
1answer
34 views
Problems burning bootloader on custom ATMEGA2560 board for High-powered model rocketry
I've designed a custom board meant for high-powered model rocket telemetry & duel-deployment. (More info upon request)
To do this, I've soldered a ATMEGA2560 (yes, overkill, but I needed ...
0
votes
1answer
30 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
38 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
71 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
91 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
32 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 ...
2
votes
1answer
67 views
How can I replace pulseIn with interrupts?
I have an HC-SR04 sensor and I need to get the distance from it. I use this code:
digitalWrite(trig, LOW);
delayMicroseconds(2);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, ...
1
vote
4answers
224 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
76 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
3answers
140 views
Why does HC-SR04 return 0s in this sketch
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
27 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
19 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
23 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
14 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
72 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
37 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
18 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
26 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
74 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
26 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 ...