Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [arduino]

Arduino is an open-source electronics prototyping platform.

Filter by
Sorted by
Tagged with
5 votes
1 answer
137 views

De/Serialize uint32_t from/to ASCII to use it in Arduino code

Despite the intention is to use it in a C++ project I put the c tag also because there is nothing C++-only (except references :)) in the code (I did not compile it ...
LRDPRDX's user avatar
  • 831
2 votes
2 answers
128 views

Robot arm control

The code in question is in GitHub here. arm.h, armconstants.h and arm.cpp. Here are the key passages: arm.h ...
pitosalas's user avatar
  • 153
2 votes
1 answer
151 views

ESP32-12: Sample analog audio and send it via udp

I want to sample audio as a learning process. In the future i want to make my dorbell "smart" and stream the audio via VoIP. But as beginning i want to sample a simple audio signal from my ...
Marc's user avatar
  • 153
7 votes
2 answers
598 views

Arduino library to simplify differential drive robots

I've written code for an Arduino library to abstract away some of the underlying logic in a particular way of moving robots. Code is posted after explanations. I'm not assuming a high degree of ...
eccentricOrange's user avatar
6 votes
2 answers
572 views

Drift correction for sensor readings using a high-pass filter

An embedded project my team is working on is having issues with sensor drift over time. To solve this, I thought it might work to use a high-pass filter, since the portion of the signal that we care ...
Juniper Mills's user avatar
1 vote
1 answer
157 views

Simulate 2-bit half adder with 2-bit inputs on Arduino without using logic gates

You are to simulate a 2-bit half adder. You are not required to implement a real 2-bit half adder using logic gates; you are going to implement a black-box system using the microcontroller that ...
Casm's user avatar
  • 13
2 votes
1 answer
121 views

Matrix led 7x10 with arduino

Good afternoon, a few days ago I finished a personal project of a 7x10 led matrix programmed with the ATMEGA328p microcontroller. To control the matrix I use 2 74HC595 shift registers in cascade in ...
Lucio Mazzini's user avatar
3 votes
0 answers
101 views

Arduino portenta H7 compatible message encryption and decryption

I am looking to build a message encryption/decription method that would allow messages to be encrypted in a timely fashion on board an Arduino Portenta H7, using as much of the onboard hardware ...
L Selter's user avatar
  • 131
2 votes
2 answers
227 views

State-machine class based upon arduino toolchain

In my quest to search or develop the 'perfect' state machine I have built the following class. With the class you can make a state machine object which comes with timing and transition methods. Being ...
bask185's user avatar
  • 128
4 votes
1 answer
536 views

Gear Shift Indicator using Hall Effect Sensors & 8x8 LED Display

I wired up a Gear Shift Indicator for my dad's car to display what gear it is currently in, and showing changes with animations (sliding up and down as appropriate, with a few bonus ones for fun at ...
Phrontistes's user avatar
6 votes
4 answers
478 views

Interactive shell for Arduino

Goal I needed to interact with microcontrollers (ESP8266 & ESP32) via the Serial interface, so I wrote a small interactive shell with the command pattern. The defined commands can either accept no ...
Eric Duminil's user avatar
  • 3,950
1 vote
1 answer
104 views

Arduino algorithm

I have 3 push buttons, 3 leds, and 2 relays. When you push button1 once, the led1 turns on and timer is set to 10 sec. When push button1 twice, led2 turns on and timer is set to 20 sec. When push ...
Sha'an's user avatar
  • 125
4 votes
1 answer
106 views

Arduino Code for Juggling Machine (Stepper Motors)

I have built a machine that juggles. An Arduino sends signals to stepper motor drivers that drive NEMA 23 size stepper motors. Video of the machine: https://youtu.be/-9zD_8erkck Currently, each arm ...
Stephen Meschke's user avatar
0 votes
4 answers
282 views

Faster map function

For my job I was tasked with writing a faster version of Arduino's map. The requirements were only use addition and subtraction, since these are cheap operations on our board. For reference, here is ...
Linny's user avatar
  • 10.1k
3 votes
2 answers
295 views

Arduino code and PING))) ultrasonic rangefinder

Context I've started digging into Arduino and different type of sensors which is fun, but I'm worried that that my coding is too explicit. I've lots of experience for coding corporate programs, though ...
FlameHorizon's user avatar
1 vote
1 answer
63 views

Calling a function once a threshold is met

I'm currently writing an API for our codebase that allows us to use an Arduino Leonardo for our tests. This code is uploaded to the Arduino, and we read through the analog for work. As stated in the ...
Linny's user avatar
  • 10.1k
5 votes
0 answers
715 views

Arduino-based darkroom timer

Description I have created a darkroom timer, which is used for enlarging and developing film. It has four separate timers, and can toggle mains via a relay to turn on the enlarger for a specified ...
marcellothearcane's user avatar
4 votes
0 answers
97 views

Control 30 LED NeoPixel clock with IR color and brightness changing

This code is designed for my 30 LED NeoPixel clock, the reason for not using the ds3231 library is due to the fact that I use codebender to download programs to my Arduino, I wanted some critique on ...
trainmaster247's user avatar
3 votes
0 answers
45 views

esp8266 code for correctness of reset and overall performance [closed]

Please review my code for the performance and correctness, everything works and we get visible wifi access points by opening http://esp8266_ip_addres/hotspots ...
Ciasto piekarz's user avatar
3 votes
1 answer
1k views

Arduino code for multi button state change detection

I created state change detection for multiple buttons, which is intended to run on my Arduino for a touchpad project. In a nutshell, the code makes sure that the Arduino only reacts to button presses ...
user avatar
2 votes
2 answers
1k views

Reading and Storing Integer from Serial Monitor

Description I wanted to understand how integers can be written and stored inside variables without the use of Serial.parseInt(). I couldn't find any code examples about this. Perhaps this is the ...
Stefan2000's user avatar
2 votes
1 answer
250 views

Arduino Conways Game of Life using FastLED

So I attempted to write Conway's game of life on an Arduino and display using the FastLED library. I use a custom bitset class to manage the game board state. I'm looking for feedback on performance, ...
HSchmale's user avatar
  • 895
1 vote
1 answer
156 views

Traffic Light which revolves around Serial Communication

Assignment description This is the improved code for a question I've posted earlier. I'd like to receive feedback on an assignment which I'm currently working on. I have to make two traffic lights ...
Stefan2000's user avatar
2 votes
1 answer
155 views

Feedback on Traffic Light which revolves around Serial Communication

Assignment description I'd like to receive feedback on an assignment which I'm currently working on. I have to make two traffic lights which allow traffic to run smoothly. I'm using a master Arduino ...
Stefan2000's user avatar
-1 votes
1 answer
349 views

Interlock of some equipments in electrical power system using simple Arduino Uno code [closed]

I'm trying to implement some logic functions essential to control a small power system consisting of 2 Transformers labeled T1 and T2, 2 Generators (G1 and G2) and a bus tie (BT). I'm not going to ...
A. Ali's user avatar
  • 1
9 votes
1 answer
1k views

Arduino Code for Talking to an RFID Reader

I've written some C++ code, intended to run on an Arduino, the purpose of which is to talk to SparkFun's Simultaneous RFID Reader. The current situation: The code runs fine, most of the time. ...
Tom Hosker's user avatar
4 votes
1 answer
117 views

This program reads from serial port, Saves this to a text file, increments file name each time it is run

I want to condense it and get rid of any noob programming errors. The code works fine but I know it's not as elegant as it could be and I really want to improve. Your advice would be brilliant! I've ...
Joel Gray's user avatar
-1 votes
1 answer
75 views

How do I re-write 3 for loops into one function [closed]

I am building a color sorting machine using a Arduino uno and a TCS3200 color sensor. I have a code that is working perfectly fine however I feel like the code could be a bit more clean seeing that I ...
Nils's user avatar
  • 1
4 votes
2 answers
98 views

Arduino project to indicate soil moisture using LEDs

I've recently started going through the Head First C book. I'd like to get up to speed in terms of writing good, idiomatic, modern C. I have read the first few chapters of the Modern C book too but ...
CamW's user avatar
  • 141
1 vote
1 answer
116 views

Python's eval command in Arduino

I have made an equivalent of Python's "eval" command in Arduino (which in itself is quite a feat) but the part that decodes the output of it is not small enough to fit in another 30 functions since ...
PyPylia's user avatar
  • 113
1 vote
0 answers
445 views

Arduino code to control motor speed based on MPU-6050 sensor

I have been trying to create arduino code where my MPU6050 reads its angle and based on that angle, change the motor speed. For example, 45° is the max motor speed, 22° is roughly half speed, and so ...
miles's user avatar
  • 11
1 vote
1 answer
54 views

Arduino Adafruit Motor Shield v2 wrapper for parsing text into commands

This wrapper library parses text into commands for the Adafruit Motor Shield v2 using the Regexp library. Currently, only the DC motor functions setSpeed and ...
mikeLundquist's user avatar
4 votes
1 answer
510 views

Vertical "moving" text on a LCD-display

Following idea: You have a LCD-display with 2 rows. You write the first line of a "text" to the second row. Then you clean the screen. After a delay you write the first line to ...
michael.zech's user avatar
  • 4,326
-1 votes
1 answer
71 views

An interface for designing Arduino code [closed]

Writing code could be divided into three parts. 1.Interface structure At this stage programmer should describe all the devices used in his project. Of course, only those of them which Arduino ...
LRDPRDX's user avatar
  • 831
4 votes
1 answer
588 views

Arduino: Change the color & color intensity of a LED periodically

Prerequisites: A RGB-LED is attached and wired to the Arduino Uno-board. Process description: In the beginning the LED is turned off. A loop starts and an output-signal is put on the red-part of ...
michael.zech's user avatar
  • 4,326
4 votes
1 answer
74 views

Average readouts from multiple IR sensors with Arduino

I've written an Arduino sketch to continuously read values from multiple analog IR distance sensors, average the last 7 values and output in millimeters. Being pretty new to both Arduino and embedded ...
Anna's user avatar
  • 143
5 votes
2 answers
335 views

Read an image with ADNS2610 optical sensor and Arduino Uno

Preliminaries I have optical sensor ADNS2610 (see datasheet here). There are a few problems which it can be used to solve, but for now let us focus on getting an image from that sensor. This sensor ...
LRDPRDX's user avatar
  • 831
4 votes
1 answer
749 views

Basic C++ IOT Weather Station

I am making an IOT weather station based on a particle photon that sends data via webhook to one of my other projects. I am very new to c++ and programming in general. What can I do better with my ...
Xander's user avatar
  • 73
2 votes
1 answer
127 views

Display temperature readings, with averaging

I've created a program to read temperature from 4 sensors, get an average and close/open 4 relays according to min/max values. Right now I'm trying to add a 16x2 LCD display to show those temperatures ...
Dante Nahuel Ciai's user avatar
8 votes
2 answers
1k views

Digital clock with many functions

I made a digital clock with the use of an RTC (DS3231) and an LCD (16x2). Current functions: Display time Display date (different formats) Display temperature (Celsius and Fahrenheit) Display day ...
Sebastiaan Speck's user avatar
2 votes
0 answers
52 views

Generic prologue/epilogue for interrupt driven Atmega328P system

My thinking is that with every application, there are a few fundamentals indicative of all interrupt driven systems. Contrary to popular opinion, assembly programs can be as maintainable as HLL's, ...
Shift_Left's user avatar
2 votes
1 answer
1k views

Initialize union with array?

I want to create a datastructure for network communication (TCP), where I can build up a byte array from small tagged pieces (like in serialized class). And of course I need a reverse behavior of ...
eszik.k's user avatar
  • 131
2 votes
1 answer
269 views

Arduino Create and send data to Serial Port (Software Serial function)

I have this code written and functioning that will write out the chars in cmd to a serial port for an input of two int values. As the majority of the byte values ...
ATE-ENGE's user avatar
  • 123
4 votes
0 answers
377 views

A GUI program for a Buzzer system using arduino

At the outset, I am a beginner at python, having started out about 2 weeks back. Aim- To create a GUI program, that can adequately work as a buzzer-management system. A buzzer, like those used in ...
stochastic13's user avatar
5 votes
1 answer
2k views

Simon Says using Arduino UNO

I built a Simon Says game using an Arduino UNO board. This was my first "real" arduino project. I would like to know how to make it better, game mechanics and code efficiency. ...
Sela12's user avatar
  • 161
5 votes
0 answers
810 views

8-bit AVR delay using TIMER0 (8-bit)

Using an Atmega328P clocked externally @ 16 MHz, this procedure is analogous to delay routines that use instructions to consume clock cycles. The intent of this algorithm is not to advocate any ...
Shift_Left's user avatar
4 votes
1 answer
773 views

4x4 Matrix Keypad on Arduino UNO

I recently bought a 4x4 keypad. It is one like this: http://www.learningaboutelectronics.com/images/4x4-matrix-keypad-pinout.png Now every code I found on the net was either using a highly overloaded ...
clockw0rk's user avatar
  • 171
6 votes
1 answer
100 views

Arduino controller to control the backlighting of a gear selector

Background The gear selector on a car allows the driver to select which state the transmission should be in. In the example picture, one of the five letters (P, R, N, D & S) lights up to ...
Zaid's user avatar
  • 163
1 vote
1 answer
13k views

Read and write data to/from Serial Port in C#

I am building a console application which will be scheduled in Task Scheduler of Windows to run my code every day at a set hour. Summing up, this application will read and write through serial port. ...
Rekcs's user avatar
  • 119
4 votes
1 answer
420 views

Reading analog moisture signal from Arduino over USB to RPi3 and publishing via paho MQTT

This program is meant to read a moisture sensor attached to an Arduino UNO board via USB to a Raspberry Pi3 which broadcasts it over MQTT. I am looking for any constructive criticism. ...
Dinocv's user avatar
  • 381