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
0answers
28 views

Morse encoder code not working as expected on Arduino UNO

I'll start saying that I don't have much experience working with Arduino and programming in C. I have an Elegoo Arduino UNO clone. Recently I was trying to build a morse encode which converts a text ...
-2
votes
0answers
34 views

When a shock sensor detects a shock, DF Player does not react immediately, but responds late [closed]

I'm not from an English-speaking country, so I use a translator to ask questions. I'm really sorry. We're making something similar to a fire alarm. But one problem is bothering us. When the gas sensor ...
0
votes
1answer
51 views

Linux Compatibility with Arduino [closed]

I'm using a PocketCHIP and its various GPIO to do fun projects. It features a full Linux OS. Every time I add an I/O device, I face enormous issues with libraries. Controlling i2c devices is an open ...
0
votes
1answer
19 views

how to put whitespace in long Serial println() input [closed]

I have this long, Serial.println() that is in quotes, on multiple lines. Arduino IDE warns: "Missing terminating character". I am certain there is a way to break the lines up, while having ...
1
vote
0answers
29 views

My port is grayed out?

Hello I have a question on why my port is grayed out when I go to upload? I’ve watched so many YouTube videos on what’s the problem and have been trying to do everything but just nothing seems to work!...
1
vote
0answers
30 views

Combining the code of MAX30100 and DS-18B20 [duplicate]

sorry to ask this but I am very very new to Arduino. My project aims to collect the skin temperature by 18B20 and the heart rate & SPO2 level by MAX30100. I have tested the codes for the ...
-1
votes
1answer
29 views

'for loop' seems to change the execution of pow()

The first time, pow() works. But inside of a 'for loop', or again afterwards, it doesn't behave !? (I'm using a Chinese Pro Mini with Arduino 1.8.16) EDIT To clarify what I am asking, my question is:...
0
votes
1answer
36 views

Optimised random alphanumeric string generator

I'm trying to build arduino nonce generator, but the only thing I found is this question on arduino forum but I can't find out how to make it work for me. I checked and Serial.available() is always 0 ...
-1
votes
0answers
34 views

cannot write to sd card Teensy 4.1

I am trying to run example data logger code for the Teensy 4.1, but the sd card never recognizes the file. I have tried formatting the sd card (64GB) in both fat16 which produces a 4GB partition, and ...
1
vote
1answer
46 views

How to change variable/sketch through a GUI

Over the past few months, I've been working on a wearable computer mouse using an Arduino and a 9-dof sensor. Most of the sketch is complete, and works as expected. Recently, I started investigating ...
1
vote
0answers
30 views

Adafruit PN532 shield: having trouble stopping the read function

I working on a wheel of fortune game and thought of using RFID cards in the segments of the wheel to identify and play certain videos when the wheel has stopped. If the wheel stops in segment A it ...
1
vote
1answer
129 views

DHT22 sensor reading code interpretes negative values weirdly (Common problem)

The following code reads the DHT22 temperature and humidity values, assuming the pin value as the sensor's host pin. When the temperature drops below 0 °C, this code returns inadequate values in the ...
0
votes
1answer
49 views

On-device logging of all Serial.print calls? [closed]

My Arduino program produces debug/error output using methods like Serial.printf. I can see all this output when it's connected to the computer, but I want to also log all this same output to my board'...
1
vote
0answers
46 views

RTClib.h problem

In Library Manager RTClib and DS3231 work somehow with older versions. RTC time can picked only once and then it give bullshit. Using newest versions screen is empty. In picture first time is right, ...
2
votes
1answer
97 views

Is there something that I need to do to make the code from this answer compile?

I tried to compile the following code (using Arduino 1.8.16 with an esp8266-12) extern volatile unsigned long timer0_millis; unsigned long new_value = 0; void setup(){ //Setup stuff } void loop(){ ...
-1
votes
1answer
34 views

Cannot change pointer for port in main loop

I am testing on an Arduino UNO. I want to use timer1 and interrupts to create various LED patterns. The LEDs may span multiple ports i.e PORTB and PORTD. I want to use a "volatile uint8_t*" ...
1
vote
0answers
64 views

Millis() based timer program for 24x7 usage in Arduino [duplicate]

I have made an irrigation system using Arduino. Timer program is based on comparing the previous Millis() and current Millis(). I want to know the chance for error when the currentMillis() overflows ...
1
vote
0answers
40 views

1.) How do I delay a servo motor from turning in a loop? 2.) How do I make a servo motor's change in position dependent on temperature?

I'm super new to the c++ programming world (currently taking the class now) and I'm in need of some assistance with some coding that's way beyond my knowledge at the moment. I have to write a code for ...
0
votes
1answer
28 views

Trying to program a Led Counter Want a Led to flash every 5 minutes however it flashes twice every second (Noob) [closed]

Heres the code i've Wrote i feel like the issue lies in how ive used the if statement int ledPinS = 13; //Classifies pin 13 as Connected to an LED //Flashes every second int ledPinM = ...
-1
votes
1answer
75 views

What is the simplest way to emulate the original gameboy's cpu using Arduino?

My initial question assumes it is possible to emulate the original GameBoy system using an Arduino board. Additional information in non-technical terms: I am looking to create an Arduino based device ...
0
votes
1answer
60 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
82 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
49 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
36 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 ...
0
votes
0answers
51 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
81 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
102 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
81 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 ...
1
vote
2answers
113 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/ ...
2
votes
2answers
102 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
60 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
50 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
580 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
167 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 ...
2
votes
3answers
167 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,...
1
vote
0answers
41 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?
1
vote
0answers
158 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
27 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
38 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
37 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
105 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
63 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
31 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
44 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
78 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
2answers
99 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
61 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
2 3 4 5
32