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
0
votes
1answer
51 views

Problem Using pins A4 and A5 for input and output I2C

Hardare used: Arduino nano ( old Bootloader ) Oled Monochrome Display ( 4 pins, 128 x 32 ) MPU 6050 Both display and MPU use A4 and A5 as I2C communication protocol, They interfere, as the MPU is used ...
1
vote
0answers
38 views

Getting Arduino to perform a command ONLY if certain time/date conditions are met [closed]

Background/Problem: There's a medication I take for ADHD that is a stimulant. I take it as needed and only take one pill on the days I do need it. However, it's long-lasting so it has to be taken in ...
1
vote
0answers
35 views

Expected signature for ATmega328P is 1E 95 0F; I can not burn bootloader on my arduino Uno

well... the problem starts from the time that I accidentally touched the crystal on my arduino and all of a sudden everything messed up; the leds on arduino turned on and off while being touched, and ...
-1
votes
1answer
41 views

Arduino Sleep to conserve battery - How to intergrade it to existing sketch - HELP pls

My sketch below is simply using a touch sensor to activate a servo motor to go from from initial position 0 to 180 then back to 0. then I want the Adruino NANO to go to sleep to conserve some battery ...
1
vote
0answers
33 views

I2C 16x2 LCD - Will Initialize (sometimes) - Holds Up The Code

Basically I have a keypad, that when a certain code is entered, it will write either "Wrong code" or "Good code" on the LCD. At the same time a timer will count down until 0 is ...
1
vote
0answers
47 views

Issues porting capacitive touch code from Arduino to avr

I'm trying to port GreatScott's capacitive touch code to avr. From my understanding the timer is constantly generating a pulse via the TIMER1_COMPA interrupt and the circuit works when I test it ...
2
votes
4answers
75 views

How or why is the Arduino keeping a LED on when the input putton is no longer pressed?

I'm trying to follow lesson 6 of the Adafruit Arduino lessons on digital inputs found here. I have the same code and the board setup the exact same and the code it is working exactly as it should. I ...
2
votes
1answer
71 views

Using MAX30100 SpO2 value to turn on LED

max30100 i2c sensor gives heartrate and spo2 reading in serial and also can show values in lcd display. I want to show it's indication via LED. If SpO2 value <94 , it will turn on Red led in ...
-1
votes
2answers
79 views

Why won't this work as a delay?

I'll start off by saying I'm very very new to coding, so please bare with me. I'm doing an assignment where the task is to create a traffic light system, but blocking delays aren't allowed. I have ...
9
votes
4answers
2k views

How do you handle sensor drift?

I have a pair of potentiometers, on the Arduino, the output seems to drift, by one or 2 digits, back and forth. I would prefer they were read as one fixed value, without variation when their knobs are ...
0
votes
0answers
77 views

Control relays with ESP8226 WIFI module and Arduino Uno [closed]

I am new with Arduino and I am using an Arduino Uno, could someone help me make this code work or tell me what's wrong with it? I am trying to control relays with ESP8226 WIFI module and Arduino This ...
2
votes
0answers
43 views

How to learn to code properly? [closed]

So, I've just started, bought the elegoo advanced starter kit, so I have different modules to work with. The kit I bought has a tutorial but doesn't teach how to program specifically, do you guys have ...
2
votes
2answers
63 views

how to config the Arduino ADC'S input on A0 instead of use default?

I am try to build this AC-DC meter, the code original used default A3 as input, how can change the input on A0? the link: https://simple-circuit.com/arduino-autoranging-ac-dc-voltmeter-with-trms/ ...
3
votes
2answers
100 views

how can I accurately recieve potentiometer values over the USB port?

I want to read the analog values of my ardunio uno into a separate c++ program. On the Arduino I have a serial port initialized for 9600 baud: int sensorPin = A0; // select the input pin for the ...
1
vote
1answer
51 views

Can I get the hex file from an Arduino without the .ino code [duplicate]

I have a CNC router table that came into my local makerspace. The board looks like it has some standard parts, but also has some parts I don't recognize. At the heart of it is an Arduino Uno. I would ...
0
votes
1answer
49 views

Artefacts on display when adding seemingly unrelated code

I have this simple program, where I am implementing a menu structure on an OLED display and a rotary encoder. The code works functionally as intended, however when I add more menu items, then I get ...
1
vote
1answer
245 views

Arduino parsing of a string using sscanf

Hello I am new to Arduino and C programming. I wanted to parse string using sscanf fuction This is my Program String hith; int field1,field2; float field3; int F1=0,F2=0; float F3=0; int h1,h3; float ...
1
vote
1answer
50 views

how to use switch case with two push buttons, I don't know how to combine buttonState1 and buttonState2

import muvium.compatibility.arduino.*; public class Class0 extends Arduino{ /* Author: First Name MI. Last Name Date: June 25, 2021 Title: Arduino Experiment 2 Description: Writing to the Output ...
3
votes
3answers
159 views

I develop an earthquake detector but when it detects a movement, the alarm doesn't stop from ringing

This is the code that I used. Actually, I use to code: for Arduino sofware and processing IDE software. Arduino Source Code/Program: #include<LiquidCrystal.h> // lcd Header LiquidCrystal lcd(7,6,...
2
votes
0answers
39 views

Program an lcd display with 12 pins

I have a screen just like this (is the datasheet). My question is, Can I use it to an Arduino board?
2
votes
0answers
108 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
0answers
24 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
0answers
37 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
0answers
32 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
0answers
29 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
1answer
103 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
1answer
50 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
0answers
49 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
1answer
30 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
0answers
33 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
1answer
56 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
0answers
43 views

communication between python and arduino [closed]

I have a python program that calculates an integer based on some parameters. I am not including the full code here because because it has a lot of deep learning stuff , but the relevant block is: #...
1
vote
2answers
97 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
1answer
58 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
0answers
76 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 ...
2
votes
3answers
265 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
2answers
34 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 ...
2
votes
0answers
73 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
1answer
171 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
1answer
62 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
147 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 ...
0
votes
1answer
23 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 ...
2
votes
0answers
46 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 ...
3
votes
1answer
85 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 ...
2
votes
2answers
89 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 ...
2
votes
1answer
289 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> ...
2
votes
0answers
31 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
1answer
46 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
0answers
21 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
33 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
2 3 4 5
32