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

Can you help me figure out how to stop a stepper motor after a certain amount of revolutions? [closed]

Hi I am programming a robot arm and trying to make my stepper stop after 1 full rotation so the cables don't break. what should I do to do this? Do I need to buy anything else or can I use what I got?
zachlikestech's user avatar
1 vote
0 answers
24 views

Code logic to measure values stored in buffer and created nested array

I am having a difficult time creating some logic in my code. I have a potentiometer connected to an ESP32 to simulate a load cell and a range sensor. The value for the force is between 0 and 400 ...
Carlos Costa's user avatar
-1 votes
0 answers
19 views

Help with Linear Actuator problem 12V

I'm new to the community, I would like your advice to help me with this project. Thank you in advance! I want to power these two 12V Linear Actuators using this LiPo Battery which I bought. And an ...
logpillow's user avatar
0 votes
0 answers
43 views

error code on the last line of my sketch

#include <LiquidCrystal.h> #include <DS3231.h> #include <DS3231.h>//Memanggil RTC3231 Library #include <Wire.h> // i2C Conection Library #include <LiquidCrystal.h> //...
DENNIS WICKERHAM's user avatar
0 votes
0 answers
40 views

Moving servos with IR sensors

This is what I have so far: The plan: I have two IR sensors I have two servos What I would like to achieve is as follows: Enter IR sensor 1 and leave, servo 1 will turn to 180 Enter and leave IR ...
PeterJoe's user avatar
0 votes
0 answers
98 views

How do you cast a comma separated list of numbers into an array? [duplicate]

In my case, in the most simplified form, I am trying to convert "1,2,3,4,5,6,7,8" to an array which should look something like this: {1,2,3,4,5,6,7,8}. This is the main part I am struggling ...
Justin White's user avatar
0 votes
0 answers
21 views

How to integrate two codes like fingerprint scanner and RFID for door lock system [duplicate]

#include <Adafruit_Fingerprint.h> SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); uint8_t id; void setup() { Serial.begin(9600); while (!...
KingJulien's user avatar
0 votes
0 answers
47 views

IRremote command stops my whole Arduino

#include <Adafruit_SSD1306.h> #include <Adafruit_GFX.h> #include <Arduino.h> #include <IRremote.h> #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) #...
Finn's user avatar
  • 1
0 votes
1 answer
48 views

ATtiny25 - assembly - BOD disable for sleep mode - error [closed]

If I understood the AVR instruction manual correctly, the ATtiny 25 can disable the BODlevel2 fuse by software, but when compiling with Studio 7 (version 7.0.132), I get the error "Undefined ...
Laur Hus's user avatar
-1 votes
2 answers
165 views

I need help for applying a logic to this code

Here's the code: int softStart = A0; int enable = A1; int powerBTN = A2, powerState = HIGH, lastPowerState = HIGH; unsigned long lastDebounceTime = 0; unsigned long debounceDelay = 25; unsigned long ...
ElectronSurf's user avatar
1 vote
1 answer
84 views

Make two LEDs fade in and out with with different PWM values

I have two UV leds, one Vf 3.3V @ 150 mA and the second one Vf 5V @ 150 mA. I need a circuit to make them fade in and out alternatively, i.e., as one goes dimmer the other goes brighter and vice versa....
Rodrigo's user avatar
  • 113
3 votes
2 answers
2k views

is #ifdef __SD_H__ considered a bad practice?

Say I'm working on a library^1 to which I want to add support for SD.h^2 but knowing for a fact that many microcotrollers don't support SD.h (therefore they result in compilation errors [eg. Attiny85])...
Giorgos Xou's user avatar
4 votes
2 answers
313 views

"if" condition problem / question

I'm new to Arduino and my question is rather theoretical. I have an Arduino Nano board (Atmega168 processor), a button, a display. I have written a button handler that does not stop code execution. My ...
ONamaeWa's user avatar
1 vote
0 answers
44 views

MKR GPS shield inconsistent GPS connection/data printing...library issue?

I have been using a MKR WiFi 1010 board with GPS shield for a very long time (year+) and have not been able to solve my problems with the GPS data dropping out. The setup for my field application is a ...
ktn8rgrl's user avatar
0 votes
0 answers
81 views

Unable to program with AVR ISP mkII under Linux

I just got an AVR ASP mkII external programmer and I am unsuccessfully trying to program my arduino with it. All the settings in the IDE are correct. This is the error message that I am getting: ...
user1584421's user avatar
  • 1,395
0 votes
1 answer
116 views

Problem with Bing generated code for automated chicken coop door

Glenn from Sweden here. I was wondering if some kind soul could help me out here. My partner bought a cheap chinese knock-off automatic chicken coop door that operates based on sunlight. Link to the ...
Glenn's user avatar
  • 13
2 votes
1 answer
155 views

Read values from a txt file on an SD card

I'm trying to read a text file (has numeric values) from SD card. The values in the file like this 87 512 255 I need to read 87 in ch1 and 512 in ch2 and 255 in ch3. Why did I get on 'SKIP_NONE' '...
stella's user avatar
  • 31
-1 votes
1 answer
243 views

convert string representing a binary number to binary

I have a serial input "1111111" and I would like to convert this to a binary B1111111 that I can send to a led matrix. I tried to search, but, all the results were misleading, led to full ...
vilmarci's user avatar
  • 109
1 vote
1 answer
136 views

ArduinoJson reading `null` from Serial

I have a setup that reads from serial when I sense that there is something to be read (and always assume that what is sent to the arduino is valid json): void setup(){ Serial.begin(9600); ...
Snappawapa's user avatar
1 vote
1 answer
210 views

How to add one JsonDocument to another in ArduinoJson

I'm utilizing this json library: https://arduinojson.org/ I am attempting to write a function that creates a response object, and wraps an already built json document: void sendResponse( ...
Snappawapa's user avatar
-1 votes
1 answer
114 views

SPI with DMA in a Arduino Due

I have a project where I need to store data (~16 Mo) on a memory and be able to fetch the data fast (<36000 bits/s) with DMA because I have other signals to take care of. Currently I use an SD card ...
Vlad's user avatar
  • 49
0 votes
0 answers
37 views

Salvaging Arduino board from Google ADK 2012

I found an old Google ADK 2012 in my closet and remembered it came with a Arduino board (?), an ARM 32-bit Cortex M3 micro-processor available at the time (possibly the DUE). The ADK 2012 design files ...
micjamking's user avatar
1 vote
0 answers
176 views

How to use multiple PN532 over i2c bus(es) and SPI?

I am working on a project that involves 3 PN532_modules to an ESP32, which sends the Tag_ID over BLE. Plan A was to use One module on i2c_1, second on I2C_2 and third over SPI. The SPI one works as ...
user91535's user avatar
1 vote
1 answer
106 views

Programming barebones ATMega328 with external programmer and no bootloader

I have created a circuit with a barebones ATMega328. I also have an external programmer (Sparkfun's Pocket AVR Programmer)... Now I want to program a particular sketch... When uploading a sketch, do i ...
user1584421's user avatar
  • 1,395
2 votes
1 answer
71 views

Functions delaying gesture sensor recognition

I am working on a simple little robot to cure my boredom and all it has is a 64 x 32 OLED for the eyes, and a PAJ7620 Gesture recognition sensor with a Seeeduino Xiao as the main board. Basically, ...
Renier Jr.'s user avatar
0 votes
2 answers
125 views

How much readable text can fit inside an ATTINY85? Feasibility of scrolling a booklet on a 0.91-inch OLED display

I'm a total beginner, so I've been talking with Chatgpt regarding the capabilities of the Attiny85 microcontroller. But the AI would hallucinate a lot and give only partially right answers (because it ...
user avatar
2 votes
0 answers
137 views

Arduino NANO RF reciever and Digispark Attiny 85 transmitter issues

I am trying to send RF signal from Digispark Attiny 85 (this one) and receive the signal with Arduino NANO V3.0 ATmega328 (this one). Transmitter and receiver are STX882 and SRX882 (these). Library ...
Le_Peck's user avatar
  • 21
3 votes
1 answer
126 views

How do I set the DHCP pool for an ESP-WIFI-MESH? [closed]

I'm building a mesh with ESP32 dev kits (ESP32-DevKitC V4) using the ESP-IDF VS Code extension and the ip_internal_network example project. The code for the example, common project components, and the ...
diomed's user avatar
  • 51
3 votes
1 answer
356 views

Problem when coding 4x4 keypad's key detection (without library)

Part of my current assignment involves reading the input from a 4x4 keypad connected to an Arduino UNO. While this may be done easily using <Keypad.h>, the project is being done with Tinkercad's ...
Maf95's user avatar
  • 33
4 votes
0 answers
53 views

Can I use regular pins (Example: D2, A3, etc...) as serial (RX, TX)?

Python/Arduino Beginner here... I have a DFplayer I am trying to hook to my Arduino and I want to hook it up through the regular pins instead of the RX and TX pins, but I've not been able to find ...
prestonferry's user avatar
2 votes
1 answer
90 views

Improving moving mouse loop to optimize speed

Code: #include <Mouse.h> #include <hiduniversal.h> #include "hidmouserptparser.h" #include <USBController.h> USBController controller; USB Usb; HIDUniversal Hid(&Usb); ...
Jake Jin's user avatar
3 votes
0 answers
64 views

nano 33 BLE problems with reading RC signal

I'm using an Arduino Nano 33 BLE and a L293D motor driver to control a three-wheeled RC robot. The sketch I'm using worked fine with my Uno Rev3, but I've moved to the Nano for size/weight reasons, ...
starthrow's user avatar
1 vote
2 answers
310 views

How do I turn on 3 LEDs in a repetitive sequence where all three LEDs would then turn OFF when the push button used is released?

Basically, how do I modify my code listed below to turn ON each of the three LEDs one at a time in a repetitive sequence while keeping the push-button pressed? Red (3 sec), Yellow (1 sec), and Green (...
Mars's user avatar
  • 39
3 votes
1 answer
245 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
353 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
1 vote
1 answer
123 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
-1 votes
1 answer
147 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
1 vote
0 answers
88 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
1 vote
1 answer
302 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
184 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
  • 198
1 vote
1 answer
39 views

Help with program upload problem

I'm going 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
241 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
175 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
34 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
63 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
  • 229
1 vote
2 answers
147 views

LoRa to MQTT sensor data can't be read

I'm trying to transfer data from a temperature sensor that is located outside my WiFi area. I have chosen LoRa technology between an ESP32 equipped with an SX1278 and a TTGO Lilygo LoRa. So far ...
Gti_roll's user avatar
0 votes
1 answer
333 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 vote
0 answers
342 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
3 votes
1 answer
223 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
35 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

1
2 3 4 5
34