As of May 31, 2023, we have updated our Code of Conduct.

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
3 votes
0 answers
29 views

How do I use a transmitter and receiver to send string messages conditionally to a receiver?

I'm working on a project to build a plant monitor that works from the outside with Arduino that picks up light and water values from it's environment then uses a nRF24L01 with an antenna and I've come ...
Mario Ronci's user avatar
1 vote
1 answer
34 views

How to drive two Stepper motors and use an Ultrasonic sensor together?

I am working on an autonomous robot using two 4-pin stepper motors, HC-SR04 ultrasonic sensor, 2 L298N motor drivers (one for each motor), and an Arduino Uno. My problem is that when I use the stepper ...
Renier Jr.'s user avatar
0 votes
0 answers
26 views

Arudino Uno: Servo Example Sketch signal: killed Compilation error: signal: killed

I'm currently trying to run a C++. Arduino sketch but I keep getting the error signal: killed Compilation error: signal: killed no matter what sketch I run, this happens both when I verify and when I ...
Astro3000's user avatar
0 votes
1 answer
24 views

How to write single binary code to output pin

I am relatively new to arduino and coding in general and im just looking for a code to write a single string of binary code e.g.; "01000111101" To a specified output pin instead of copying ...
Arbadatduino's user avatar
-2 votes
0 answers
61 views

what is wrong with my code? it is not working [closed]

#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int LEDR = 8; int LEDB = 7; int LEDGr = 6; int Button = 9; int COLOR; int Beep; int PSE; int TME; int RTME = 0; void ...
sheesh's user avatar
  • 5
-2 votes
1 answer
39 views

4 corner weighing system

I have seen multiple videos on how to make a single weighing scale. Is it possible to use 4 small pads to weigh each corner of a 1/32 scale car and show the results on one screen?
Craig's user avatar
  • 5
-1 votes
1 answer
23 views

Arduino-project with color sensor and rgb-led

I want to use a color sensor for my Arduino project with Arduino Uno to detect the colors red, green, blue, orange, yellow purple of leaves of paper and then light my RGB led in those colors. I have ...
user90576's user avatar
0 votes
0 answers
22 views

stepper control with buttons

Do need help in to trying to control a stepper motor with a overshoot protection. I am using a Nema17 with a A4988 driver to control a loading plate. The pate holds racks which get loaded. when 1 rack ...
Martin Scribens's user avatar
0 votes
0 answers
26 views

UNO like Device, Loaded BootLoader, Cannot Load Sketch [duplicate]

This is not a question about the Duemilanove bootloader. This is a question about one of 15 units that will not load a sketch. Something in one out of fifteen is different and I am looking for ideas ...
Forrest Erickson's user avatar
1 vote
0 answers
26 views

how to config size USB mass storage arduino nano ble 33?

I see that they arduino nano ble 33 support USB 2.0. Is there a way for us to create a USB mass storage of about 200kb for convenient storage of configuration files and history files? I see example ...
Nguyễn Thuận Hải's user avatar
0 votes
1 answer
58 views

RFID card read loop seems to stop

I successfully programmed an RFID card reader to switch lights on and off if any rfid card is presented. I have tested this and it works, with the lights continually switching on and off if any rfid ...
Christine's user avatar
1 vote
0 answers
39 views

What is the most simple sketch to confirm the DAC works for audio on a speaker with it's own amplifier for an ESP32?

I have a PC speaker with it's owner power supply (no amplifier needed). It just uses a standard AUX jack. Most examples sketches use an amplifier like the MAX98357A. I have explored some libraries too,...
adamaero's user avatar
  • 194
-1 votes
0 answers
31 views

How can I control arduino HID wirelessly

I am relatively new to Arduino creations and want to make a USB Arduino device that will press multiple keys when it receives a Bluetooth signal. I think I have the HID part figured out after ...
JOOT49's user avatar
  • 1
2 votes
0 answers
19 views

Help with program upload problem!

I'm gonna to upload some code to my LeArm using an Arduino board. I connected the rx and tx pins of the LeArm to the Arduino, but I got an error message when I tried to upload the code. I'm not sure ...
CharNgai's user avatar
1 vote
0 answers
47 views

How can I program an Arduino Pro Mini with an ESP8266-01 connected to its TX and RX?

I am working on a project that uses an Arduino Pro Mini to gather information from various sensor. Once the readings are taken I turn on an ESP-01 from a separate dedicated 3.3v power supply. The ESP-...
user1114881's user avatar
0 votes
1 answer
133 views

if statement does not work with fraction, but works with decimal equivalent

I'm trying to trouble shoot a problem with my code and narrowed it down to my if statement not working with a fraction. The below code does not work and returns 0 for(float i=0; i <= 1; i += .0001){...
LB Burkhardt's user avatar
-1 votes
1 answer
18 views

Creating an IPAddress object from an unsigned int

If I create an IPAddress object using a decimal IP address, it appears to be reversed. What am I doing wrong? See code examples below. IPAddress addressOne(192,168,50,1); Serial.print(addressOne); ...
dbarck2000's user avatar
1 vote
0 answers
38 views

How to save the current SPI settings with out have a global variable keeping track?

I am making a function for one of my devices, my device needs a particular SPI setting. I was hoping to save the current setting of the SPI class into some variable, load in the required setting, do a ...
DrakeJest's user avatar
  • 231
0 votes
2 answers
50 views

Lora to Mqtt sensor cannot be read

I'm trying to transfer data from a temperature sensor that is located outside my wifi area. I have chosen the Lora technology between an ESP32 equipped with an SX1278 and a TTGO Lilygo lora. So far ...
Gti_roll's user avatar
-1 votes
1 answer
56 views

how to "skip" one parameter of a method with a default value letting it use it's default value, but change parameters after it [closed]

lets say we have a function like this(fictional): function1(int Z, int X, bool Y=true, int Count=10, int ID=1,bool TeaTime=false); And I want to run this function, but I want to change all parameters,...
TeD van Loon's user avatar
-1 votes
2 answers
213 views

Execute a loop function out of the main loop() [closed]

I am having trouble with part of my code. I am working on a program, that using a sensor and a dfplayer, should play a track and while the track is being played, a LED should be turned on with a fade ...
Lahey Corey's user avatar
1 vote
0 answers
138 views

ESP8266 not sending text message to telegram bot

I've been trying to get my esp8266 to send a message to a telegram bot as soon as it connects to the wi-fi, whenever it encounters an obstacle, or whenever an SOS push button is pressed. But I didn't ...
Lucent1712's user avatar
2 votes
1 answer
80 views

Arduino hangs / freezes - can't figure out why

I am building a remote controlled boat. My remote project freezes after an arbitrary amount of time. The serial stops output, the OLED doesn't update anymore and instructions are not send / received ...
user2863494's user avatar
1 vote
0 answers
30 views

Atmega328P constantly restarting when defining a function

I wanted to make a simple led on/off program using USART interface. When the code doesn't have any functions other than main it runs fine, however Arduino keeps resetting when one is included. At this ...
L1RG0's user avatar
  • 19
-3 votes
1 answer
116 views

Using internal voltage reference for sensor

i am using 3.7~4.2V lithium battery. I am using internal voltage reference to read constant battery voltage as we know that the battery voltage level depletes overtime. The problem is that my sensor (...
electro_nooobbbb's user avatar
1 vote
1 answer
101 views

Will an Arduino Nano work instead of Teensy 3.2?

I hope this is ok to post here and I appreciate any suggestions or help and opinions/facts to make this work. First off I’ve Never programmed an Arduino device! I was looking at this project: https://...
Sundrop's user avatar
  • 19
-1 votes
1 answer
74 views

RGB LED randomized colors and LDR fading at the same time

Im trying too make an RGB LED that keeps changing color's randomly, and makes the brightness fade at the same time with an LDR, yet I keep getting an error that says too many arguments to functions. ...
Sudras Elagor's user avatar
0 votes
2 answers
124 views

How does Arduino handle passing this union?

I'm unsure how this will be handled by the Arduino compiler. If anyone can explain what and why, I'd appreciate it. This is obviously very simplified, but it does contain the actual issue. At the ...
Jim Mack's user avatar
  • 231
-2 votes
1 answer
84 views

Arduino code giving error while compiling [closed]

I am a beginner, and I'm trying to make code to control a servo using two ultrasonic sensors. I've tried to make the code, but when I tried to compile it using my simulation app, it gives this error: ...
Joseph Afodu's user avatar
0 votes
1 answer
57 views

is there Raw RTC output?

I have an I2C Real Time Clock, DS3231 RTC module , and I just want something like Unix Time. I'm using the uRTCLib, looking at the class methods but dont see anything like that. I'm thinking there ...
j0h's user avatar
  • 882
3 votes
1 answer
100 views

Detecting an approximate angle/location of a light source using phototransistors

Note: [I am approximately two weeks into learning Arduino and hence have little experience with utilizing Phototransistors.] My plan revolves around placing four identical Phototransisors which are ...
Alexander Watkins's user avatar
-1 votes
1 answer
47 views

4x3 keypad not providing any output and the output it does provide is incorrect

I am trying to figure out how to use a 4x3 keypad and just want to receive the key numbers I select on the serial monitor. The problem I am getting is that some of the keys I type don't give me any ...
Campbell White's user avatar
1 vote
1 answer
171 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); ...
Maximus Su's user avatar
1 vote
0 answers
70 views

Nucleo F446ZE VS Nucleo F446RE

I don't know if this is the right forum to ask this, but I can't find people that want to help, so let's try it here... First I had an F446RE, and program it in PlatformIO with an Arduino Framework... ...
Swets's user avatar
  • 11
-1 votes
1 answer
103 views

How to write a program to do 2 different loop | Task?

I wanna write a program for rc-plane navigation The plane must navigate to 2 waypoints waypoint_1 & waypoint_2 When it reaches to waypoint_1 (with miss-distance =< 5) then navigate to ...
Curious guy's user avatar
0 votes
0 answers
51 views

ESP32 DEV Module with fixed IP-Adress and OTA

I've been trying to use OTA on a ESP32 with fixed IP-Adress. I am using the ArduinoOTA Library: arduino-esp32/libraries/ArduinoOTA at master · espressif/arduino-esp32 · GitHub In the code OTA without ...
Carlos Costa's user avatar
0 votes
2 answers
633 views

The same button with one click and double click [closed]

i hope to get some help with my code. I am trying to distinguish between a single press and a quick double press of the button with debouncing. I am making some silly mistake in my code and i can't ...
Carlos Costa's user avatar
-1 votes
1 answer
123 views

Buttons pressed in correct order

I’m trying to figure out the best way of doing this, currently using a bunch messy if-statements which kind of work. I have an IR sensor and three buttons that all need to be activated in the right ...
Jason8899's user avatar
1 vote
1 answer
886 views

How do I control the speed of a 2-wire fan with an Arduino and only a potentiometer?

I am trying to vary the speed of a 2-wire fan by using a Arduino Uno and only a potentiometer. Initially, I assumed that I could go about doing so by using a code that I used for dimming an LED. When ...
AI09's user avatar
  • 13
1 vote
0 answers
60 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 ...
Tazbot815's user avatar
0 votes
1 answer
286 views

CRC8 code not working properly

I need to send a string followed by its CRC8, 0x31 polynomial (= X^8 + X^5 + X^4 + 1), I've coded this successfully after some troubles, but it doesn't seem to work properly when I check the results. ...
Myst's user avatar
  • 11
2 votes
0 answers
179 views

Coding issue with Fast LED Multiple Colour Palettes in a State Machine

I am working on a project using the WSB2812B LED strip, with a ATmega644A using the MCUdude/MightyCore plug in (https://github.com/MCUdude/MightyCore). I am using Fastled 3.3.3 with Ardunio 1.8.13 on ...
Newbie's user avatar
  • 21
1 vote
1 answer
232 views

Motor with ultrasonic sensor

I am new to programming so bear with me. I am writing a simple code to control a motor such that the motor will turn at full speed as long as the sensor does not detect an object within 5" of the ...
Pilot Ken's user avatar
1 vote
1 answer
96 views

memory leak w/ no Strings involved

I'm trying to read data being transferred via Infrared from my Smartmeter on my ESP8266 using the following sketch: #include <ESP8266WiFi.h> #include <ESP8266WebServer.h> #include <...
1_am_r00t's user avatar
-3 votes
2 answers
342 views

Error when compiling program for esp32 with Preferences.h

I'm trying to write a program for an Adafruit ESP32-S2 TFT Feather. I However cannot get it to compile my program involving any use of <Preferences.h>. I can't get Arduino IDE to compile even ...
Tristan's user avatar
  • 11
-2 votes
1 answer
346 views

Convert Int to HEX, HEX to string and to byte? General converting problem

Since Cpp is not my main language, I struggle to find the best way to convert between types for my needs. So my starting point is struct can_frame { canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR ...
uneasy's user avatar
  • 99
0 votes
2 answers
160 views

Multiply char with float

I have a value for led brightness that is stored as an unsigned char (0-255) unsigned char* colors[3]; colors[0] = 255; colors[1] = 0; colors[2] = 0; I want to multiply a brightness percentage to ...
spuder's user avatar
  • 111
1 vote
1 answer
408 views

Mouse.move: how do I move the mouse to the center of a screen?

I have a program operating in full screen mode. I would like to move the mouse to the center of the screen. Is this something I can do with the functionality of Mouse.h? https://www.arduino.cc/...
j0h's user avatar
  • 882
-2 votes
1 answer
45 views

How to set number in address field?

I want to build structure of record. The problem is that I can't build the address field correctly. Can any one help me? P.s: the address[16:2] is start from bit 61 to bit 47 so please you can't say ...
Mahmoud Elkout's user avatar
0 votes
1 answer
106 views

L LED keeps staying on

I am trying to get the Arduino to reboot my PC when it is off. Using the front panel header on the PC, I connected the power switch and PLED directly to the Arduino Uno as the header only outputs 5 V. ...
Ant's user avatar
  • 11

1
2 3 4 5
33