Questions tagged [algorithm]
An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
21 questions
10
votes
5
answers
6k
views
Efficient algorithm/data structure to calculate moving averages
Currently I am developing a graphic LCD system to display temperatures, flows, voltages, power and energy in a heat pump system. The use of a graphic LCD means that half of my SRAM and ~75% of my ...
4
votes
1
answer
703
views
How to determine when a sensor's output signal changes significantly?
Starting with an analog signal from any sensor, how do I automatically determine if there is a real signal change or a reset? Below is the sample code that better explains my goal:
value = sensorRead()...
2
votes
2
answers
667
views
How do I find the whole number (n) that when multiplied by (m) will be closest to (x)? [closed]
I've designed an apparatus that uses stepper motors, and they are linked together so that when armature A turns, it consequently moves armature B by a ratio of 1/4. In order to keep armature B in the ...
2
votes
2
answers
2k
views
Exoskeleton Motor Control Code
Background:
I have been working on an exoskeleton project with a group of friends, and I need help. I made another post on the robotics.stackexchange site for the drive system: https://robotics....
2
votes
1
answer
2k
views
How to detect if more than one button was pressed
I am designing a turn signal bicycle blinker using two pushbuttons as input, one for each side, with a corresponding light for each button.
The idea is this:
Pressing one side makes same side start ...
1
vote
2
answers
669
views
Using millis() instead of delay() when playing a melody
I want to make my Arduino to play several simple melodies, and also be able to skip a melody by pressing a button and go on with the next song. therefore I cannot use delay() because the code should ...
1
vote
1
answer
1k
views
How do you balance an Arduino quadcopter using calculated gyro values?
I was working on an Arduino quadcopter project. I setup all my hardware and was having balancing problems with my software end. I am using an MPU-6050 gyro and accelerometer. I have calculated the ...
1
vote
0
answers
64
views
Need help with debugging a heartrate/filter code (the heart rate calculation does not work)
The code below is a program that aims to apply the Pans-Thompskin algorithm to a signal attained from a ECG filter. The filter seems to work alright but it fails to blink the LED and collect a correct ...
1
vote
1
answer
272
views
How to detect patterns in an FFT output?
I have an FFT output from a microphone and I want to detect a specific animal's howl from that (it howls in a characteristic frequency spectrum). Is there any way to implement a pattern recognition ...
0
votes
1
answer
133
views
Call function and not came back
Im having a little problem with my code. here i called a function to make a test, if it passed it goes back and continue if it doesn't it goes to main loop.
void loop()
{
if (call == 1)
{
...
0
votes
1
answer
465
views
comparison in a time sequence [closed]
in an Arduino sketch a user is invited to input a number representing a time in the format HH:MM, this number is to be added at the end of an ordered and limited sequence of times
--the first input (...