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
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
70 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
33 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
76 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
110 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
65 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
105 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
74 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
59 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
51 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
28 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
vote
1answer
99 views

4 Bit Counter up and down

we are asked to create an Arduino code that would run a 4 Bit Binary UP counter once a push button switch is pressed and then 4 Bit Binary Down counter on the second click. Then vice versa. This ...
-1
votes
1answer
43 views

How to make Arduino react to serial information?

I want to write a program that allows me to control the LED connected to pin 13 of the Arduino. When the program is started, the LED should be off. The user should open the serial monitor to ...
0
votes
1answer
199 views

confirming this will blink LED at given frequency

I want to blink an LED at an specific frequency, ie: 7Hz here what Im doing int ledPin = 4; float freq = 7; void setup() { pinMode(ledPin, OUTPUT); } float periodo() { float peri = 1/freq; ...
0
votes
1answer
47 views

Whats wrong with my POST request?

Ive been trying to get POST working on my ESP8266. I followed this tutorial https://techtutorialsx.com/2016/07/21/esp8266-post-requests/ which works, but once i change the request URL to anything else ...
1
vote
0answers
54 views

Storing data in Arduino Portenta H7's SDRAM

I am working on storing data from Portenta H7's ADC through a high sample rate (>100kSa/sec) per channel. I am using 2 ADC channel for my work. Through the forum, I learned that the serial. print ...
-1
votes
1answer
36 views

Efficient workflow/tools for converting color images to hex arrays

I would like to display 65k color animated gifs on my oled. I'm using the adafruit library for https://learn.adafruit.com/096-mini-color-oled Now I need to convert a significant number of images to ...
0
votes
0answers
26 views

Servo moving in steps of 10º after Servo.attach without any write command

I am new to Arduino and I was trying to test some code with servos. However, once I place the Servo.attach(myPin) to the code my servo starts moving continuously in steps of around 10º, with a delay ...
1
vote
0answers
29 views

Aurdino EMG sensors and servos?

I'm new here and to the aurdino. I'm building a 3D printed robotic arm controlled by a EMG sensor. I purchased a V3 EMG board and leads on Aliexpress. Here's a list of the things I've purchase for ...
1
vote
0answers
40 views

Controlling fluid flow with ball valve and flow control using arduino

I am pondering on a project to do the following : I want to control fluid rate using a ball valve and servo/stepper motor I have a flow rate sensor that can give me a flow value. I want to use a 1602 ...
0
votes
1answer
96 views

What's wrong with this code..?

I want to make an 8*8 led matrix. I found this code on the web: int latchPin = 12; //Pin connected to ST_CP of 1st 74595 int clockPin = 13; //Pin connected to SH_CP of 1st 74595 int ...
1
vote
1answer
39 views

unable to modify NTPClient to use static IP address

I tried the example File > Examples > ESP8266WiFi > NTPClient which requests the current time and it worked fine. Then I tried to modify it so that the ESP8266 would have a static IP ...
5
votes
3answers
515 views

Using Arduino as a standalone compiler

I mostly program in C/C++ so I conviniently have a GCC compiler for all my compilations. I was wondering if there is a special compiler for Arduino that can be used just like the GCC Compiler? Because ...
0
votes
2answers
40 views

How do I program an LCD screen and do I need an Arduino

I am trying to create a small device with a screen that tells the date and time. I am thinking of using a UCTRONICS 0.96 Inch OLED Module (type that on Amazon). I am very new at coding, and I know ...
-3
votes
1answer
50 views

How to put a condition on HTTP.POST?

I set my code to if it executes HTTP.POST, the count will reset / back to zero, but I noticed that even it returns other http code than 201 (-1 or 500), the count still resets. How to put a condition ...
-1
votes
1answer
58 views

Need help with millis () function for two linear actuators

Last week I was grateful to receive help programming the Arduino to control two linear actuators. I need help re-writing the code using the millis () function. I am more than happy to reimburse for ...
1
vote
1answer
35 views

How do I power a linear actuator at different speeds for specified periods of time

I am new to Arduino and wondering if anyone can help me get it programmed correctly. I am using two buttons to control a linear actuator to open and close a barn door. I want it to go a certain speed ...
0
votes
0answers
55 views

Infared: some controllers send code into infinite loop

I have a piece of code that captures input from infrared and spits it out to the serial port. When I use it with a simple controller that comes with a typical kit, it receives the infrared code just ...
0
votes
1answer
56 views

Splitting up code in multiple files causing `multiple definition` and `undefined reference` error

I have the following very basic program that reads MPU6050(accelerometer and gyroscope) sensor using the I2C library, and prints the sensor information. This program works as expected. #include <...
0
votes
0answers
13 views

query of arduino sketch with regards to employment of gsm sim900a module

what i'm trying to do is to send message to one whose no. is used in code about balance of sim_card plugged in sim900a. but i get commands in message or blank message after using ATE0. what i was ...
1
vote
1answer
58 views

Adding zero padding to decimal values

I want to add zero before the float number like this: 010.0 The code I'm using is this: if(value < 10){ lcd.print(F("0")); } lcd.print(value); But when the value is exactly 10, it ...
1
vote
2answers
59 views

Best Data model/Concept to Store Multi-Day Alarm for clock?

I'm writing a multiday day alarm program for a project. I'm not sure how I want to store the format of each of 10 alarms....I need to store it...in SPIFFS retrieve it(at boot) and then compare it to ...
1
vote
0answers
54 views

Binary to gray using arduino [closed]

I am using arduino two ic 4511 and two 7 segemnt I am trying to convert binary into Gray code and on one 7 segemnt I successfully showed binary of number as I use arduino pin 12,13,14 for input and ...
1
vote
0answers
33 views

Changing the servo motor operating direction using arduino

I want to turn the servo motor 90 degrees with the first double high inputs, then I want to turn the motor 180 degrees with double high inputs, but the motor turns 180 degrees with one high input. ...
0
votes
1answer
91 views

How to upload code to atmega32u4?

I recently created a pcb with the atmega32u4 to use it as a development board. The controller is connected to a micro usb port. Should I install the arduino bootloader instead of the deafult one? Or ...
1
vote
1answer
50 views

Why do I get different results when compiling the same code with different ide?

I have a basic code about reading true rms.I compiled the same code with arduino ide and atmel studio, then ran it in a proteus simulation.I'm trying to measure how long the read_rms() function takes. ...
-1
votes
2answers
158 views

Rounding to the next upper (or lower) 0.1

I'm reading from a temperature sensor. I get float values with 2 decimals. I want to round them to nearest 0.1. This is my sketch: void setup() { Serial.begin(115200); } void loop() { float ...
0
votes
1answer
132 views

Bare Metal Programming of Due

I don't know much about Arduino but I am interested in buying a Due 32bit board. I was wondering if you can program it bare-metal and if this requires a separate debugger or not? Thanks
1
vote
0answers
120 views

Wemos d1 mini code not uploading

I have a wemos d1 mini. I uploaded a code in wemos d1 mini and after that my wemos mini not working. I tried to upload another code in it even the led blink sketch and even a blank sketch but whenever ...
1
vote
1answer
55 views

Asymmetric encryption on a Teensy?

I want to monitor an input and then send the information in an encrypted way that can't be easily unlocked even if a malicious actor gets access to the device itself. I'm new to using the Teensy ...
1
vote
0answers
38 views

Bluetooth Controller

Im doing a project in which there are two arduinos with both of them having hc05 bluetooth modules. Now how to connect them both so that both stay connected and one is used as a remote control so that ...
1
vote
0answers
40 views

IR remote signal interference

Im trying to make an arduino project which uses IR remote control and does certain thing. My doubt is the weather the hex codes of some remotes be similar and if they are how to tell arduino to only ...
2
votes
2answers
52 views

RAM cost of entering functions

A friend has told me I shouldn't rely on functions because, during execution, they occupy a significant amount of RAM. Is that true or, if it isn't, what's the maximum suggested level of function ...
6
votes
5answers
2k views

Is there any better choice other than using delay() for a 6 hours delay?

I am designing this incubator system and I need to drive a motor forward and reverse every 6 hours. Is there any better choice other than using delay(). A 6 hours delay seems a little unprofessional.

1
2
3 4 5
33