All Questions
Tagged with coding or programming
1,681 questions
1
vote
1
answer
1k
views
Arduino create Json Array with double values and 2 decimal point
How i can create a Json Array with double values and 2 decimal point using the ArduinoJson Library?
https://arduinojson.org/v6/how-to/configure-the-serialization-of-floats/
In the folowing small ...
-1
votes
1
answer
194
views
Externally powering Arduino while reading voltage off it via USB
I have an Arduino UNO R3 where I’ve set Pin 13 to “HIGH” (as shown here) and I’ve connected an LED to Pin 13 and GND which glows brightly using a USB attached to my MacBook Air providing (I think) 5V.
...
2
votes
1
answer
3k
views
lcd.createChar() only allows for 8 custom characters
I have a teensy4.1, with a 16 by 2 LCD screen, and an I2C LCD interface.
I was trying to write a bunch of custom characters to an LCD screen, to flip some text.
my issue is that it works fine, but on ...
1
vote
1
answer
103
views
What is my code lacking that the servo rotates non-stoppingly? Servo should rotate 180 when distance is <= 50 and 0 when this condition is not true
My code represents a water level sensor, and the components are the Arduino Uno, a breadboard, an ultrasonic servo and two LEDS in which one is red and the other is green.
The condition that I don't ...
-1
votes
1
answer
205
views
Displaying multiple temperature outputs w/Thermistors
So I asked this question a couple days ago but did some more work with some of the coding, but I'm really stuck and need some help. I'm trying to display the temperature for each separate thermistor ...
0
votes
1
answer
278
views
How to get started with writing code for a Hall Effect sensor?
One of my biggest questions concerns coding a Hall effect sensor to find wheel speed with an arduino mega.
I’ve got an lcd in digital pins(7,8,9,10,11,12) and a Hall effect sensor in digital pin 2.
I ...
3
votes
1
answer
3k
views
How to build an arduino project with multiple source files?
I'm building an arduino program on linux, using the following Makefile:
ARDUINO_DIR = /usr/share/arduino
BOARD_TAG = uno
ARDUINO_PORT = /dev/ttyAMA0
ARDUINO_LIBS = Wire
include /usr/share/arduino/...
1
vote
1
answer
863
views
Uploading to an external Atmega328P with a clone UNO R3 with soldered chip
As a complete newbie, after much looking for the best bargain, I ended up buying one of these UNO R3 clones, without realizing it had the chip soldered on the board. It looks like this:
It works OK ...
0
votes
2
answers
279
views
How I can use more than 64 analog in arduino
Hi dears
I want help I’m in begging in programming. I want use more than 64 analog pin for ldr photoresistor in single reading. Because I can’t use digital pin 0-1.
Any methods I can use ,,,,
And ...
-1
votes
1
answer
2k
views
Convert from raw data to float from DDSU666-H
Hi professers, i am trying to read the data from DDSU666-H ( Smart metter) CHINT using modbus RTU, i only get the raw data but i don't know how to convert it to float , in the code below is about ...
3
votes
1
answer
1k
views
How do I run 4 LEDs sequentially based off of a push button input?
I am trying to create a program that runs 4 LEDs sequentially while also being able to do other things with different inputs and outputs. Because of this, I am using the millis function and not the ...
-1
votes
1
answer
124
views
Pressed Buttons are permanently low and one of them is not working [closed]
I am a beginner to Arduino, and I'm having a problem in a project that I am currently working on.
I was just beginning to write the code, after preparing the components and the wiring, and suddenly ...
0
votes
1
answer
4k
views
7-Segment Display w/ Potentiometer
(Backstory) So, I took an computer engineering class in high school (grade 11 level), where I learned a bit about breadboarding as well as arduinos (I would like to stress a bit). It has been 5 years, ...
1
vote
1
answer
154
views
RF Keyfob single button code
I'm making a project where a 2 channel RF keyfob (433Mhz) controls an led using arduino nano. As for the hardware everything works and I have tested it with the example decoder code and it works fine. ...
0
votes
2
answers
93
views
Having issues Connecting to a web server and pulling the data back
I have some arduino code where I am trying to pull information from four different locations. Three are working great and the fourth I am not getting any response.
These two strings work perfect in a ...
1
vote
1
answer
160
views
I am trying to add a countdown to my Arduino code but it does 0 days, 04:09:36 instead of starting at 7 days
The code I use probably has a math problem since an Arduino can only count a 16 bit integer. This problem is with the WeekDelay() function.
The project is for an Aerogarden. It pumps water into the ...
1
vote
1
answer
340
views
Stepper motor with microstep driver
In my project I have to control a stepper motor using arduino and microstep driver, can I control the motor so that it can move 90 degrees then stop for like a second and then move again and repeat ...
-1
votes
1
answer
190
views
I have been having a lot of trouble adding a countdown to a piece of code [closed]
This is the code. The /// are where I added the countdown. Unfortunately the countdown only goes down 9 seconds. What I want it to do is go down the full 24 hours. I have been trying to fix this error ...
2
votes
1
answer
101
views
"Simple" code...but what have I done wrong? [closed]
This code compiles without problem, but doesn't work at all... The switch does not set the LED low and the while loop doesn't work, plus the serial print doesn't print....
Until I put the while loop ...
1
vote
1
answer
101
views
Morse encoder code not working as expected on Arduino UNO [closed]
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 ...
0
votes
1
answer
328
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 ...
3
votes
0
answers
130
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
0
answers
32
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
1
answer
73
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
1
answer
2k
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
vote
1
answer
337
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 ...
0
votes
2
answers
2k
views
DHT22 sensor reading code interprets negative values weirdly
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 ...
1
vote
0
answers
292
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
1
answer
468
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
1
answer
101
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
0
answers
92
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
0
answers
143
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
1
answer
59
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
1
answer
335
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
1
answer
696
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 ...
3
votes
1
answer
2k
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
1
answer
149
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
0
answers
183
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 ...
2
votes
4
answers
222
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
1
answer
492
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
2
answers
143
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 ...
10
votes
4
answers
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
2
answers
743
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
2
answers
262
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
1
answer
582
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
1
answer
189
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 ...
2
votes
1
answer
5k
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
1
answer
2k
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
3
answers
233
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
0
answers
95
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?