All Questions
Tagged with programming arduino-mega
127
questions
1
vote
1
answer
204
views
Run encoder code simultaneously with other code in Arduino
volatile unsigned int temp, counter = 0;
int county=0;
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
attachInterrupt(0, ai0, RISING);
...
1
vote
0
answers
67
views
Need help with calling an API using an Arduino system
As stated in the title, I need help with calling an API. I'm trying to integrate make a call using the Verkada API but it seems to be using a cURL library that I'm not entirely certain I can get to ...
-1
votes
1
answer
99
views
Displaying multiple temperature outputs w/Thermistors
So I asked this question a couple days ago but did some more work with some of the coding, but I'm really stuck and need some help. I'm trying to display the temperature for each separate thermistor ...
1
vote
0
answers
493
views
Arduino Mega as a EEPROM Programmer for Winbond W29EE011 memories
I'm trying to use my Arduino Mega as an EEPROM memory writer. For this project, besides my Arduino Mega, I use an SD Card module, an LCD display and two push buttons to handle the events. Inside the ...
1
vote
0
answers
262
views
Send Multiple Sensors Data into single Packet in Arduino
I have two sensors data in packet but now I want to send these two sensors data into single packet in which these two sensors data are gathered. I mean I want to have a packet in which I have oxygen, ...
1
vote
1
answer
322
views
Send packet of multiple sensors data to Bluetooth module
In my project I am using 3 sensors. I am sending a regular stream of sensors data to Bluetooth module but now I want to send data in form of packet (which may be 30 bytes or 40 bytes of size) in ...
1
vote
0
answers
82
views
Arduino Mega with Sensors and tftlcd 2.4 inch
I am working with tftlcd 2.4 inch with Arduino mega 2560 board. In this code I just want to show clock as my default or home screen. By clicking on clock at any point on screen user should get a new ...
2
votes
1
answer
369
views
Arduino Mega Clone CH340G Capacitor Values
I'm making my own Arduino Mega board with ATmega2560-16AU and CH340G. Jump to the end of the post to find the real question.
I have already ordered a PCB before and it didn't work when I soldered ...
1
vote
0
answers
28
views
Touch sensor trouble
I need help I use Touch Sensor(T)v.0 and it always receives a signal not matter I touched it or not.
Here is the code.
#define TOUCH_PIN 7
int touchVal = 0;
void setup() {
Serial.begin(115200);
...
0
votes
1
answer
68
views
Deactivate pushbuttons at initial stage
Pl someone answer my question. I have 4 pushbuttons namely add/reject/start & finish. I want to
1.Deactivate add/reject buttons at initial stage until start button pressed &
2.Once add/reject ...
1
vote
0
answers
119
views
Arduino mega PinChangeInterrupt with 16 bit timer
With reference to this question ::I have written a program by using 16-bit timer,
The program is as follows .
volatile uint32_t ovfCount = 0;
struct Pulse {
uint32_t last_toggle;
uint32_t width;
...
1
vote
1
answer
310
views
Issue using Arduino Mega Timer2 with PinChange Interrupt
I was working on a program to measure the pulse width , for that I thought of using Timer 2 in Arduino mega along with pin change interrupt,
The program I have written is as follows
volatile float ...
0
votes
1
answer
130
views
What's wrong with this code..?
I want to make an 8*8 led matrix. I found this code on the web:
int latchPin = 12; //Pin connected to ST_CP of 1st 74595
int clockPin = 13; //Pin connected to SH_CP of 1st 74595
int ...
1
vote
0
answers
70
views
Infared: some controllers send code into infinite loop
I have a piece of code that captures input from infrared and spits it out to the serial port.
When I use it with a simple controller that comes with a typical kit, it receives the infrared code just ...
0
votes
3
answers
467
views
How do i make my DC motors run simultaneously?
Im coding an adafruit motor shield for 3 DC motors to go forward & backwards, and so my concern is why only my motor3 is running the whole time and motors 1 & 2 are switching off meaning 1 ...
0
votes
1
answer
96
views
Use Android on Arduino TFT
I don't know whether this is possible or not but is there any way that I can run something similar to Android on a normal TFT. I want to make complex graphics but can't program those complex programs ...
-1
votes
2
answers
141
views
Use normal TFT Shield with SD as a Nextion Display
I have a normal Elegoo TFT 2.8" display shield that also had an SD reader. I am trying to use it as a Nextion display. I want to do this because the Nextion tool allows you to make very nice ...
1
vote
1
answer
1k
views
Can Arduino UNO permanently store a code?
I'm really new to Arduino and wanted to know if I can make Arduino a permanent controller?
and could you help me with a cheaper alternative?
I also wanted to know about "fuse", i read it ...
2
votes
1
answer
162
views
My motor driver gets stuck in either high or low with a certain speed super randomly. Motor output stops going based on accelerometer input
Running a DC motor(6.5A max input), motor driver (MD10C 7Amp peak output), and arduino Mega.
Basically, I am creating a stabilized object based on the accelerometer's input. It works great but all of ...
0
votes
1
answer
801
views
Sending data struct with 2 int fields from Arduino to Raspberry via NRF24L01
I'm trying to do wireless thermometer on max31865 arduino and nrf24l01 but I'm having problem sending whole data struct I can send int or char arrays but when I try to send whole struct I got output ...
1
vote
1
answer
65
views
Update class attribute with attachInterrupt
I want to refactor this code
/*
YF‐ S201 Water Flow Sensor
Water Flow Sensor output processed to read in litres/hour
Adaptation Courtesy: www.hobbytronics.co.uk
*/
volatile int flow_frequency; // ...
0
votes
1
answer
300
views
I have a question,an error occured in my code saying TIMSK was not declared in the scope(There are no errors)
#include <SmartInventor.h>
void setup() {
SmartInventor.DCMotorUse();
}
void loop() {
// M1, M2, M3
// CW, CCW, STOP
// 0-100
// 0-360
SmartInventor.DCMotor(M1, CW, 10);
delay(...
1
vote
2
answers
1k
views
How to make a dynamic menu with a sub-menu ( Arduino mega or Arduino Uno)
I have an arduino mega with a LCD shield (from keyestudio KS2056). I am trying to create a menu with a submenu that would have addable and removable strings based on inputs from a RFID scanner(addable)...
0
votes
1
answer
184
views
MCU to MCU communication over UART
What would be the best way to send the following information from one MCU to another?
Now I'm just sending the sentence over as is eg. Serial.print(sentence in here)
Example sentence: 1306,60.123456,...
0
votes
2
answers
127
views
Coding issue with for loop
I have an issue with this piece of code concerning the use of 3 capcitance sensors each outputting a midi note chosen from one of three scales selected with a pot. Regarding the sensors triggering ...
0
votes
4
answers
77
views
How to link a computer processor to an Arduinno on a board? [closed]
I am completely new to Arduinno, so please forgive if the question is stupid.
Here is the problem: I have a project where I want an Arduino (or similar microchip board) to handle some sensors and ...
2
votes
2
answers
616
views
Mixed structure with int and string
I want to create a structure like this:
struct commands
{
int cmd;
char descr[25];
};
commands cmds[] =
{
{16, "Hammond Organ"},
{17, "Percussive Organ"},
{18, "Rock Organ"},
{ 0, "" ...
0
votes
1
answer
1k
views
Use JYETech 2.4 Inch LCD Display Screen Module with Arduino?
I have this JYETech 2.4 Inch LCD Display Screen Module that I would like to use for a project I have in mind, however, I'm not sure how to wire it up with my Arudino Mega. Here is the datasheet for ...
1
vote
2
answers
166
views
How do I segment Arduino program when line count is so large that code maintenance is difficult?
I'm looking for the Arduino/C++ equivalent of COBOL's 'copy' statement.
I'm working on a program that is approaching 600 lines of code in the TopLevel.cpp source file. This is hard to manage ...
1
vote
0
answers
68
views
Function parameter of type int not working as expected
I am attempting to write a small sketch with the Arduino IDE (1.8.10) to set the colour of an RGB LED, however my function for setting the colour of the LED is behaving strangely.
Here is the full ...
1
vote
0
answers
144
views
Made a light controller for the holidays
I am a new the world of Arduino. I found on YouTube, how to build a light controller (https://www.youtube.com/watch?v=WvG9c84ApFA&t=39s). I follow every step but it doesn't work. Here are some ...
0
votes
3
answers
92
views
Arduino keeps looping
I made a program where I give a number(4 bit) as input and four led on the breadboard lights up according to its binary. The problem is the program works all well only for (2-15) but if I give 0 or 1 ...
1
vote
2
answers
2k
views
Combining code for multiple sensors in a single program [closed]
I need to operate 3 different sensors (taken 6 sensors of each type) by Arduino Mega2560 :-
DHT11 (temperature-Humidity sensor)
MQ5 (gas sensor) and
Soil Moisture sensor
{taken 6 of each type (total=...
-1
votes
1
answer
118
views
Servo starts rotating whenever it is plugged
I am making a fish feeder using an Arduino Mega 2560, a servo motor SG90 and an RTC DS3231. I want to make it rotate twice a day, i.e. morning and 9 o'clock evening.
Whenever I plug my Arduino board ...
0
votes
3
answers
389
views
Code getting stuck waiting for GPS Output
I'm basically trying to make a device that pulls the GPS information from a SIM808 and pushes it to a server online via GPRS.
I am sorry as I am not good at programming so ive spent days trying to ...
-1
votes
1
answer
120
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
2
answers
291
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 ...
3
votes
1
answer
1k
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(...
3
votes
1
answer
121
views
Can I use GSM and Data Logger Shield at the same time on one Arduino?
Me and my classmates are trying to make an arduino base project where we will be using sensors, GSM, and Data logger shield. We want the arduino to store the data collected and at the same time send a ...
3
votes
2
answers
5k
views
HC-05 bluetooth module not accepting AT commands
I have been attempting to program my HC-05 ZS-040 Bluetooth module for quite some time, and I cannot get the AT commands to return any values. I have searched google for quite some time, and I none of ...
0
votes
2
answers
367
views
Reed Sensor matrix for chess board query
NOTE:
This is not a question that has been answered previously in similar questions.
I am using an arduino Mega
I have gone through Bergers Blog(schematic is in this link), but have been breaking my ...
2
votes
2
answers
5k
views
Can you use digital pins as PWM output?
I am currently working on a robotics project that requires 16 PWM outputs to control 16 servos. Is it possible to use Arduino Uno's digital pins as PWM output pins through code?
If it is not possible,...
3
votes
1
answer
250
views
Can't display any number using 74HC595
I just started using elegoo UNO R3 and I have the problem displaying different numbers on the segment display using the 74Hc595. I have no problem with the uploads and the circuits are working fine. ...
1
vote
2
answers
191
views
When i press a button to subtract 1 from 5 it skips to 3
When i press a button to subtract 1 from 5 it skips to 3, it's the same when I add 1 to -5 it skips displaying - 4 and goes straight to -3.
This is the code that i am using:
//Testing the use of ...
-1
votes
3
answers
314
views
How do I create boundaries for the possible values of an integer? [closed]
I want to create an integer whose total value cannot go beyond a range of numbers when added to and subtracted from. For example, if the "total_value" started at 0 (of a total possible range between -...
-2
votes
1
answer
195
views
What does drawmenu() mean [closed]
Can anybody tell me what drawmenu() means, I got an answer on here that has the term on and I don’t quite understand it, I’m very new to this.
Any help you can give will be greatly appreciated.
...
0
votes
1
answer
387
views
How to create a log file document which is not editable by a word processor on SD card
I'm using a Arduino Mega 2560 and SD card shield to make an industrial logging panel. Is there any way to write log data document in a read-only type file like a pdf on SD card so that the contents ...
0
votes
1
answer
220
views
Supervised inputs for alarm panel
I'm using an Arduino Mega 2560 to make a fire alarm control panel. The control panel takes 50 (inputs) supervised inputs. The normal way as mentioned in the link is to use the analog inputs, which I ...
1
vote
1
answer
1k
views
Code that worked in Uno/Nano is not working in Mega - help me port the code to Mega
I used the code from this project... to build an oscilloscope-like project. It worked fine with Uno and Nano.
Later I tried to do the same with a Mega, but I don't know what's wrong. It's not ...
1
vote
0
answers
161
views
Create PWM pulses by comparing the cosine wave with AnalogRead potenciometer
I need generate 4 pulses, for the digital outputs, for example 8,9 and 10,11, at this moment I am using an Arduino Mega.
The pulses have these characteristics:
1) 8 and 9 are the same pulses, but I ...