Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
36 views

expected unqualified id before token

here is the code. PROBLEM:- if I use for the loop the error comes "expected unqualified-id before for .......but if I use the void loop instead of for loop...the code is run without any error. ...
2
votes
1answer
50 views

Newbie question - Biltong Box Project [closed]

I am a newbie to electronics, but I do have experience working with electrical wiring in the UK, so I am comfortable working with 240V reasonably safely. I have also built a camper including all the ...
3
votes
1answer
191 views

What's the function of this transistor on Arduino Mega?

I am trying to get information about the transistor on the Arduino Mega board below: It says "340P" on the transistor. I want be able to know which model transition is this so that I can check its ...
0
votes
1answer
28 views

Sketch talks to Android via BLE on Serial2 but times out after 5 seconds when Serial cable disconnected or not present

From an Android phone I am using the "Serial Bluetooth Terminal" app to communicate to an Arduino Mega 2560 with a Bluetooth Low Energy HM10 (Jaycar XC-4382) module connected via Serial2. If the ...
0
votes
1answer
31 views

Maximum signal frequency obtained at the gpios of arduino mega 2560

Is it possible to obtain the rectangular pulse signals of freuency 10 MHz simultaneously at the GPIOs of arduino mega 2560?
1
vote
0answers
69 views

Interfacing MAX6675 with Arduino Mega 2560

I'm trying to use a thermocouple k type and a MAX6675 IC. I bought the MAX6675 chip and made the circuit (just a 1 nf capacitor on +5 V and GND near the IC) with the help of the datasheet I used the ...
1
vote
2answers
91 views

Expand Arduino storage without an SD card [closed]

I'd like to have my Arduino write some files and store them somewhere. They won't be big files, but the 1Mb available on the device won't be enough. I know an SD card is the popular solution, but the ...
0
votes
1answer
32 views

Capturing interrupt on both edges when it's set on RISING or FALLING

I've been trying to capture rising edge of an IR sensor output. This sensor's Vcc connected to Arduino 5V and it has a digital output pin. I've observed the digital output pin on an Oscilloscope. It's ...
0
votes
2answers
71 views

Problem with modbus communication between two arduinos when writing more than 27 registers

I have the following problem: I want send 200 registers from a modbus master to a slave. Both are arduinos. I can't send more than 27 registers. When I send more i get the Errorcode 255 which means ...
0
votes
3answers
79 views

I can send on software serial, but not read?

I've been cracking my head over this for a long while. Like many before me, I'm trying to send and receive data from a HM-10 bluetooth module, arduino mega adk and the app called BLE Scanner. I've ...
0
votes
1answer
18 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
1answer
28 views

3V Arduino options

I have an Arduino Mega board to test 3V devices. Which is the simplest way to connect those 3V devices to the Arduino Mega (it works at 5V) without burning them? I saw the Adafruit Trinket works at 3V,...
2
votes
3answers
104 views

Having some issues with an array

I am having an issue that I can't seem to get my head wrapped around. What I am trying to accomplish is to have a minutes worth of sensor data in an array (reading every 5 seconds) so I'll have 12 ...
0
votes
2answers
58 views

Time between two IR beam sensors

I am working with two sets of IR beam, they are to be placed in X distance. My goal is to measure speed. I would like to measure time between the first IR beam to the second beam when the beam breaks. ...
0
votes
1answer
47 views

Calculation error with Optical Encoder

I have corrected my code for reading the optical encoder index but I am now getting a different calculation error. At the index the encoder reset's to zero but now my readouts are as follows: Index ...
1
vote
1answer
51 views

Dimmer.h issues with ATmega 128

I am using a ZCD circuit controlling a TRIAC. Now I am using Dimmer library for this purpose. It works fine with ATMega 328 but whenever I try to upload the code in ATMega 128 using Arduino IDE this ...
0
votes
2answers
60 views

Voltage Regulator getting too hot

I have an Arduino mega that is being used to control relays and ultrasonic sensors. The relays that I am using is a 4 DPDT Signal Relay Module Model: D-256 Series and the other is a 4 channel Single ...
0
votes
1answer
88 views

Changing PWM on Arduino Mega, pins 9 & 10 to 20 to 25 KHz

I'm trying to run a Nema 17 motor with a l298N motor Driver for a school project. The issue is that I am running the motor with PWM to avoid overheating of the driver, however the resulting noise at ...
0
votes
1answer
42 views

Not receiving the complete messange sent by SIM900

I need help with SIM900 and Arduino Mega. I do not receive the complete message that I send from my phone. (Arduino Mega _ SIM900 _ Alimentation 9V/2A) Message sent: 1234567891234567890 Message ...
0
votes
3answers
39 views

Iteed SD card breakout info for Arduino

I got an SD card breakout from an online shop, its the iteed kind without the level shifter, it has the 3.3 / 5 V switch. I cannot find any libraries or write example for it. Has anyone dealt with it ...
1
vote
3answers
460 views

Can now() roll over just like millis()?

I'm using now() and millis() to trigger events after a certain time has passed. I am aware, and it's also easily found on the web, that millis() rolls over after a certain time has passed and for code ...
1
vote
2answers
51 views

How would I go about measuring an analog signal on my arduino mega that has both positive and negative voltages

I have a signal that fluctuates between -70mV and 50mV. How would I get the arduino to read this.. Ultimately I am trying to graph the data in real time so it looks like this. https://imgur.com/a/...
0
votes
1answer
77 views

Garbage stored in SD card

I am an electronics graduate and an embedded design engineer, working in this field for about two years apart from the hobby time during my graduation. I am currently working on a system that has an ...
-1
votes
1answer
107 views

How to create a weather station with only GY-BME280-3.3 chip and w5100 Ethernet shield mounted over arduino mega 2560 r3

Want to create a weather station with only GY-BME280-3.3 chip and w5100 Ethernet shield mounted over Arduino mega 2560 r3 but I have no previous experience with Arduino. And The Arduino will be hooked ...
0
votes
1answer
121 views

No data sent over serial port in linux c++

TL;DR - I am attempting serial communication with Arduino with code that I found here and nothing gets sent over (Arduino programmed to respond, and I checked that it does with its serial monitor) Hi ...
0
votes
1answer
48 views

Optical Rotary Encoder Index issue [closed]

I have the following code working correctly except for the Index portion. I am not sure if I have the syntax correct for the hardware. The end result I am looking for is to have the encoder reset to ...
-1
votes
1answer
66 views

State change detection with a colour sensor

I have added static variables to this code and instead of getting repeated notes whilst dwelling on green, I get a single note instead. This is what I wanted. However, my loop isn't allowing for a new ...
0
votes
1answer
26 views

Interfacing 4 ESCs and an Arduino with a single LiPo battery

I have 4 BLDC motors, and 4 ESCs, one for each motor. But I have one LiPo battery from which I want to power one Arduino Mega and all the 4 ESCs. Can I remove the connectors from the ESCs and put them ...
0
votes
2answers
65 views

8relay module asks more than specs

I have a 8 relay module that should use not more than 20 mA per relay. Altough when measuring it asks around 70. If I use 6 relays, that would be more than an Arduino Mega can give. (I already lost 1 ...
1
vote
1answer
77 views

Reprogram Atmega 16u2 on Arduino Mega with Arduino IDE?

I had an Arduino mega 2560, suddenly Arduino didn't recognize my computer and I thought the problem is about Atmega 16u2 and I decided to copy hex file from another Arduino Atmega 16u2 and paste to ...
0
votes
2answers
34 views

Read sensor data repeatedly after specified time?

I want to read sensor data using analogRead() after every 5ms. I have read other answers to similar questions but what I'm confused about is: let's say, I made a loop to read sensor data using ...
1
vote
0answers
82 views

Making '*' key on keypad a backspace key

Using a 4x3 membrane keypad and I want to make the '*' key a backspace if the wrong number is entered. I am a newbie and having a hard time trying to figure out how to code that, any help would be ...
0
votes
1answer
28 views

SIM808 return the same AT command

I am using atmega 2560 and SIM808. When I send an AT command to SIM808 it returns correctly. But sometimes I have seen that SIM808 returns the same AT command. Sometimes it occurs due to lack of power ...
0
votes
2answers
45 views

getting SPI SSD1307 to work on Arduino Mega

After some time off, I decided to get back into my project after some help from this topic I started earlier Difference in pinout (types?) Uno/Mega. Unfortunately, even tho I have read multiple times ...
0
votes
1answer
42 views

Uno to Mega and where is the error for the interrupt that isn't delared?

I want to read a Omron E6B2-CWZ6C Incremental Rotary Encoder w/Index (360P/R). A couple questions, I found out that an Uno can only handle 2 interrupt pins and I think I need 3 for the Index. What do ...
1
vote
2answers
98 views

How do I properly send and receive MIDI with Arduino?

I'm using Arduino Mega. I tried to find specific topic about this and can't find any. The target is actually send and receive MIDI, then forward it as rtpMIDI using esp8266 (thats the start of the ...
1
vote
1answer
146 views

Midi controlled LED by USB [closed]

I am trying to create something that will allow me to control an individually adressable LED strip using an electric piano using its midi output. Some things to note: The piano can output midi ...
0
votes
1answer
28 views

How to Create a reference to an External Print object

Right now I have an object: class Dog { public: Dog(uint8_t I2c, Stream& feedback); void Speak(); private: uint8_t _I2c; Stream& _output; }; Dog::Dog(uint8_t I2c, Stream&...
0
votes
1answer
70 views

Watchdog Timer for atmega 128

I am using atmega 128 for a smart vehicle tracker. I am trying to use watchdog timer for this controller.But problem is that I have found the maximum watchdog reset time is 2 seconds. I need watchdog ...
0
votes
1answer
25 views

Arduino loop over a function is always displaying 0 as final values

I trying to loop over a function in arduino to get values for 2000 times, and then divide it by 2000 to get an average offset: int16_t x_offset = 0; int16_t y_offset = 0; int16_t z_offset = 0; And ...
1
vote
1answer
50 views

Can I use a camera sensor from a not functioning smartphone in Arduino or Raspberry pi?

I want to use the OmniVision_OV16860 camera sensor from a not functioning Moto G4 plus phone to capture pictures using Arduino or Raspberry Pi. Is it possible to do that? If yes, explain the whole ...
1
vote
1answer
69 views

Looking for a waterproof SPI temperature sensor

In my current project I'm using a DS18B20, which seems to be the only temperature sensor to show up when googling for waterproof temperature sensor for an arduino. The sensor itself is fine, however, ...
2
votes
1answer
102 views

Arduino Mega and gyroscope erroneous values

I have Arduino mega2560 and MPU6050. I connected to Vcc pin of the gyro to +5V on the mega, the SDA to SDA pin, SDL to SDL pin, AD0 and GND to 2 GND pins. I used this code: #include<Wire.h> ...
0
votes
1answer
153 views

How to configure TinySine 3G module (SIM5320E) for HTTP GET request

I recently bought a 'TinySine 3G shield (SIM5320E) 900/2100Mhz' based on Adafruit_FONA libraries to use with Arduino Mega 2560 R3. It successfully registered with Vodafone AU. Other functionality ...
0
votes
1answer
212 views

Using Arduino wireless SD Shield to save data to sd card and send to PC over wireless network

new here. I'm using an Arduino Mega to monitor the current & voltage input to four different sensors. This works fine - the sensors work as expected and I can view the results via the Serial ...
2
votes
1answer
81 views

Why the MPU6050 gyroscope read write register value is 0x08 for a full scale of 500 degrees per second?

I am trying to connect a gyroscope MPU6050 to arduino ATmega2560 and read its raw values from its 6DOF (gyro and acc). I found the following code: //Activate the MPU-6050 Wire.beginTransmission(...
0
votes
0answers
73 views

How to read and change value of registers of MPU6050 to change the default scale range of gyroscope and accelerometer?

I want to read the value of I2C register of MPU6050, and other registers like the scale range selected of a gyro. The I2C address according to MPU6050 datasheet is 0x68. I wrote this code: #include ...
0
votes
0answers
17 views

Arduino Mega and MPU6050: Reducing the code [duplicate]

I am trying to work Arduino Mega AT2560mega and gyroscope MPU6050. There is a premade code on Arduino forums, where all registers of MPU605 are defined and the code is about 800 lines. I can't find ...
1
vote
1answer
252 views

When using an Arduino as an ISP, is the capacitor required or not?

Looking at Arduino as ISP and Arduino Bootloaders, it is stated The 10 µF electrolytic capacitor connected to RESET and GND of the programming board is needed only for the boards that have ...
0
votes
1answer
436 views

Interfacing with an SSI sensor?

I'm trying to interface with version RM08S of this rotary encoder using an Arduino Mega. The sensor supports a "Synchro serial interface (SSI), single ended" interface. I'm unfamiliar with this ...