Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

Filter by
Sorted by
Tagged with
1
vote
1answer
157 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
0answers
21 views

Can i run my python based virtual Assistant using esp32 I want it use it as a user endpoint? [closed]

I have a working project which is python based virtual assistant and now I am thinking to make it more accessible than carrying my laptop. I want to make a device like alexa echo dot more or less.. ...
1
vote
0answers
32 views

Expected initializer before 'myservo' [closed]

Hello i am getting into Arduino and want to get my code tidy. I dont know how but thought by #include "Stepper.h" and "Servo.h" would work. The programm shows it works. But now it ...
1
vote
1answer
31 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
3answers
72 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
0answers
20 views

MYO arm band based 6 degree of freedom robotic arm controlling? [closed]

their is an arm band known as myo which can controll the gestures of hands and can transmitt it via its built in software or blutooth 4.0. i want to controll a robotic arm through it. so can any body ...
0
votes
1answer
21 views

First Project (auto garden)

I've been tinkering for quite a while and I'm looking to try out an arduino to control an automated small garden project for growing seeds. I've never done any coding before and am looking for some ...
1
vote
0answers
26 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
1answer
50 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
2answers
64 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
1answer
252 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
0answers
25 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
0answers
31 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 ...
0
votes
0answers
27 views

Need code for reading&plotting a quadrature encoder signal

some help needed! I have a high quality quadrature encoder with outputs A+, A-, B+, B-, Ref+, Ref-. If all edges are read, the encoder gives 108000 ppr. For the frequency, in my setup it makes a turn ...
1
vote
0answers
14 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 ...
1
vote
0answers
17 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-...
0
votes
0answers
43 views

I need to make button to turn off my alarm on clock

well I get task to make school project alarm clock using arduino, xd as you can see im not very good at it i mean i know something but not everything so please can someone help me, i copied this code ...
1
vote
0answers
27 views

Create a 7 segment display out of controllable LED strips to display digits

Highschool newbie here I'm trying to create a 7 segment two-digit display (88 shaped) to display the number of times a distance sensor detects something passing in front of it Here's what I've done so ...
0
votes
0answers
35 views

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 [duplicate]

**void setup() { pinMode(11, OUTPUT); pinMode (4,INPUT); } void loop() { int y= digitalRead(6); // push button 2 static int counter {} ; int x= digitalRead(4);// push button 1 ...
0
votes
1answer
39 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
0answers
39 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
1answer
77 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); ...
0
votes
0answers
24 views

Making an Arduino Project with different actuators and sesnors

I have been trying to make a Arduino automated home safety system with a Fire Sensor, RFID Card Reader and PIR motion sensor. I have three actuators as well - Active Piezo Buzzer, DC Relay(to ...
1
vote
0answers
43 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
1answer
28 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 ...
0
votes
1answer
41 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
1answer
98 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
1answer
38 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 ...
1
vote
0answers
26 views

Can someone please show me how to make an LED chaser with 4LEDs [closed]

I want to make a LED chaser with 4 LEDs that run from right to left, but when we push a button it runs from left to right?
0
votes
1answer
36 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
1answer
60 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
0answers
23 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
3answers
69 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
1answer
54 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
0answers
21 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
0answers
75 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
1answer
67 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
2answers
32 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
1answer
30 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 =...
0
votes
1answer
62 views

Calculate Timezone from GPS Coordinates

I have a uBlox NEO-6M GPS module and it is outputting longitude and latitude. It is also outputting time which is UTC. I want to use the GPS coordinates to calculate the timezone and then subtract and ...
0
votes
1answer
30 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
3answers
85 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
2answers
61 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
2answers
80 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 ...
1
vote
0answers
39 views

How do I take nrf24l01 received data and place its value into another sketch

I am working ( attempting more like it). To complete a direction sketch showing up to 360 degree rotation remotely using nrf24l01 modules. I have succeeded following Robin2 examples up to this point. ...
1
vote
0answers
69 views

Arduino interface of push button and led using millis()

I am working on a project of blinking of led using push button without delay().The limitations of led blinking is in accordance with the no of times the push button is pressed the led should blink ...
1
vote
1answer
56 views

RF sniffer with Arduino

Hello programmers out in the world. I am doing a capstone project for an RF sniffer to capture RF signals from Key fobs within an OEM manufacturing plant. I want to be able to decode this RF signal to ...
1
vote
0answers
50 views

I2C and SPI connection in the same-time [closed]

I want to make code between to devices , the communication between the I2C master to master , but in the sometime the one of the connect with other device SPI bus master to slave . how it work?
1
vote
1answer
47 views

How to make car turn 90 degrees?

I have an elegoo car model and am trying to make it turn 90 degrees whenever it gets to a 90 degree turn. This model has line tracing and it works fine on curved surfaces but doesn't work so on 90 ...
0
votes
1answer
24 views

Error Compiling for board Arduino Nano while using Adafruit GFX

Whys is this happening to me?? I have to meet a deadline please help!! Here is my code. #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h&...

1
2 3 4 5
33