All Questions
Tagged with coding or programming
1,681 questions
1
vote
0
answers
747
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
84
views
Click counter using SparkFun Qwiic Twist
I wrote the script below in order to count the number of times that I press the SparkFun Qwiic Twist. But when I press the button, I get series of running numbers on the Serial Monitor and not a ...
1
vote
0
answers
74
views
State machine controlling dc motor/ buzzer/ lcd / ultrasonic
I ran into some problems here with programming. I am trying to put together a code for 4dc motors, buzzer, ultrasonic and lcd to work together,. they will together make up a small car. when the ...
1
vote
0
answers
256
views
DC motor and buzzer blink without delay code
So I am trying to put together a code for 4dc motors, buzzer, ultrasonic and lcd to work together,. they will together make up a small car. when the distance to the ultrasonic is smaller than 10cm, ...
1
vote
0
answers
54
views
Can't transfer information from esp8266 to arduino
I have esp8266. Which I am trying to set up to be a self-contained access point and server (tcp).
ESP8266 is connected to ports 2,3 of Arduino Uno. On Arduino, I want to process all information coming ...
3
votes
1
answer
253
views
Anyone know why my pushbutton is always returning HIGH?
Been trying to figure this out for a couple hours, despite how ridiculously simple it should be. I have no idea why it's always returning 1, even when i'm pushing the button. Fritzing sketch:
My code:...
3
votes
1
answer
364
views
How can I pause serial transfer and then un-pause it?
So I am running a USB (UART) connection from my Arduino UNO (using the serialtransfer.h library) to my pc (using the pyserial transfer library).
This how the INTENDED cycle of code goes:
I receive the ...
1
vote
0
answers
383
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, ...
0
votes
1
answer
216
views
Atmega328p with arduino without the board
Perhaps this is a beginners question and I am not sure. I currently have a custom made circuit with an atmega328p chip connected to an mpu6050. However, when I program in Arduino I am not sure what to ...
1
vote
0
answers
257
views
How to name the temperature sensors instead of printing address using ds2482-100 and ds18b20 sensor- Help
I am using 10 ds18b20 Temperature sensors using with "DS2482-100" I2C board and Arduino
so when I am getting the output like this:- "ROM = 28 46 04 1F 0D 00 00 74 96014B467FFF0A100A 25....
1
vote
1
answer
547
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
2
answers
273
views
Delay coding not working as expected
Added second attempt at bottom of code, Please check it, works with out lag time but never turns Vacuum off? This project is pretty well explained in the code description. My main problem is I need a ...
1
vote
1
answer
90
views
How to send a message to my phone that my Arduino system is on when turning on my Arduino
i have installed a GSM shield on the Arduino to create security alarm system using PIR SENSOR when ever there motion I will receive a call to my phone.
but i want to add also a line of code which can ...
1
vote
0
answers
162
views
Project doesn't work after 2 - 3 times, requires frequent turning off and on
I am new to Arduino and I am working on a project. This project inspired me and I tried doing it.
The following code was provided in the description:
int maxPeople = 5; // maximum number of people ...
3
votes
3
answers
2k
views
Arduino Nano 33 BLE - use of flash to store data; how to expand a piece of sample code
I've been looking into how to store data in between restarts. With an Arduino UNO, there are plenty of EEPROM libraries, but I'm not finding something 'off the rack' for the Arduino Nano 33 BLE.
I ...
0
votes
2
answers
62
views
Unexpected output for simple code involving calculating a time interval of 10ms
I had written some code that involved doing something after 10 milliseconds had elapsed, however it was performing unexpectedly. Upon debugging, I think I have identified the error, and I wrote some ...
1
vote
0
answers
366
views
Servo motor won't work for a specific code
I have written a code with interrupts to control the servo but my servos are not working. One is meant to work with interrupt but the other one has to simply move but it is also not working. Even the ...
1
vote
1
answer
584
views
Hexadecimal array does not add up as expected
I have an array of hexadecimal values as given below.
byte Hexa_Val[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
I want to increase this array from the end. As in, go from {0x00, 0x00, 0x00, ...
1
vote
1
answer
4k
views
Is there a way to go to the start of the void loop() function kind of like a "continue" keyword in c in loops?
I am new to Arduino programming and am trying to make an obstacle avoiding car with an ultrasonic sensor and a differential driver model. While learning how to code it, I learned that you can exit the ...
2
votes
3
answers
2k
views
Create a dead zone for joystick
I'm trying to create a dead zone so the joystick will turn the motor off completely when in the center position. It's much too sensitive and will start the motor if barely touched. How could I fix the ...
1
vote
0
answers
194
views
Problem getting data from Arduino pro mini
I am currently working on a drone project using multiwii.
I m using mpu6050 as gyro and accelerometer sensor with i2c protocol. I was able to read data coming from mpu6050 while using Arduino Uno ...
2
votes
1
answer
347
views
What is the difference when an arduino has been unplugged vs when a serial port connection was closed?
Using python code for a serial port connection to an arduino, it sends a value to the arduino, which then starts printing values to serial. The python code will print the value on the first or second ...
1
vote
2
answers
689
views
Using millis() instead of delay() when playing a melody
I want to make my Arduino to play several simple melodies, and also be able to skip a melody by pressing a button and go on with the next song. therefore I cannot use delay() because the code should ...
1
vote
1
answer
473
views
Fast PWM with Arduino, the inputs outputs don't work
Hello to the community!
I am using ATTINY85 and I am programming it through the AVRISP using an Arduino UNO.
This is the code I am using :
#include <avr/io.h>
#include <avr/interrupt.h>
...
1
vote
0
answers
125
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
153
views
Arduino buzzer code sequence not triggering
I have a problem with my arduino buzzer:
the code should be doing the following:
I have a security system where in order to open the door you have to enter a 4 digit code from the remote. If the code ...
1
vote
0
answers
183
views
Error in program that measures distance from a ultrasonic sensor
I am trying to use an ultrasonic sensor in conjuncture with different devices like a proximity sensor and a solenoid and alarm.
This is how the project is supposed to work:
A container is placed on a ...
2
votes
0
answers
472
views
Use AGPS functionality with Arduino and GPS module
Recently, we developed the UTRAQ L100 GNSS Module base board for testing all the capabilities of the GPS receiver.
https://www.elementzonline.com/blog/utraq-gps-l100-module-based-on-irnss-supported-by-...
1
vote
1
answer
618
views
Minimal example of Task Scheduler Blink?
Scheduler_example00_Blink is ~300 lines. For just an Arduino Uno, what is a minimal example?
It's hard to know what belongs and what doesn't. This example has six different approaches, and I'm just ...
1
vote
0
answers
76
views
Problem using sequential loop
So I have created this project to have an LED blinking at a constant speed whenever the program is running. The first LED (green) will blink faster and faster the closer an object gets to the sensor. ...
1
vote
1
answer
212
views
Make an LED Turn
//Make an LED Turn ON after pressing a push button switch for five times. Add a reset switch to turn OFF the LED whenever the reset switch is pressed
**void setup()
{
pinMode(11, OUTPUT);
...
1
vote
0
answers
1k
views
converting int or float into bytes array in arduino
I am trying to send data from one arduino to another over ethernet using udp protocol.
In arduino writing data over udp is like this
UDP.write(buffer, size);
where buffer is an array to send as a ...
1
vote
1
answer
288
views
4x4 matrix keypad not working
I'm working on a research project that allows me to press a button on a matrix that then outputs a parameter like temperature, humidity etc. But I cannot find out what is wrong with the buttons, when ...
1
vote
1
answer
4k
views
Why do I need to use latin-1 instead of utf-8 when using python with arduino?
When reading and writing with a python serial port connection to arduino, if I don't use latin-1 ('ISO-8859-1'), the results are not as expected. Like if I have
int outP = 5;
//...
int outV = Serial....
2
votes
1
answer
135
views
Any advice on how to repeat the song 6 times instead of infinitely?
//Here is my code so far
int speakerPin = 9;
int length = 28;
char notes[] = "GGAGcB GGAGdc GGxecBA yyecdc";
int beats[] = { 2, 2, 8, 8, 8, 16, 1, 2, 2, 8, 8,8, 16, 1, 2,2,8,8,8,8,16, 1,...
0
votes
1
answer
130
views
I have a problem combining two different sketches into one sketch
Below are two attached the two codes, the second code is for using a microphone to detect for cough and sneezes where the first code is used for humidity and temp.
// For Scanning Insitu Exhale ...
0
votes
1
answer
2k
views
Arduino while loop with or condition
How do I write a program to wait (delay) until one out of two buttons pressed? I have written a program to wait until a single button is pressed. It's working fine. However, if I extend it to second ...
2
votes
1
answer
551
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
55
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
3
answers
172
views
Where to go after Arduino?
I apologise in advance if this question is not right for this Stack or if it has been answered before but here goes. I have been learning C/C++ using the Arduino Uno and have gotten the hang of it now ...
0
votes
1
answer
91
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
94
views
Directly synthesising an OOK modulated LF signal using a CSV file
I'm looking to transmit some data (CSV files) from a measurement instrument underground to a receiver on the surface. I've learned that in order to penetrate the limestone, low frequencies have to be ...
1
vote
0
answers
160
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
449
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 ...
-1
votes
2
answers
164
views
How do I switch between while loops before the current loop finishes? IR Remote + LED's
I have a project that requires rotation of a tank tread. I've simulated LED's to go off in a rotation using an IR Remote. I want to stop the clockwise rotation halfway through so I can immediately ...
0
votes
1
answer
255
views
Does setting a value always mean setting a Arduino pin?
One thing that always confused me was why we use int or other commands to set the variables to have pin numbers as if those commands were always restricted to pin numbers only. For example
int ledPin =...
-1
votes
1
answer
109
views
Simple ESP to ESP reading blink program not reading input voltage
One ESP32's 3v3 is connected to GPIO 26 of another ESP32.
The program is uploaded. The built-in LED lights for two seconds as expected. Then, it turns off. No matter what GPIO pin the 3v3 is connected ...
2
votes
3
answers
1k
views
Collecting data from a timer interrupt and storing it into an array
My question is: how can I use an ISR and store the data I get from my analog inputs into an array for easier data analysis.
More specifically, I want to collect my data using an ISR function (internal ...
0
votes
2
answers
1k
views
random() Function isn't random at all
I'm using the random() to generate random coordinates for coins in a simple game console. The problem here is that the random() function is not generating random numbers, since the coin is at the same ...
0
votes
2
answers
2k
views
Can a 12V sensor connected to a 5V output signal of an Arduino Uno
I am doing a project for object detection. But my problem is I'm using a 12V photoelectric OMRON sensor to connect with 5V Digital PWM port 3 on Arduino using normal coding. Do I need an extra circuit ...