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
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 ...
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
0
answers
96
views
Reliably using analogRead as a compact digitalRead
My goal is to reduce pins being used for micro-controllers with limited pins, or projects requiring a few different digital input values.
How I intend to do so is by using ADC pins to gather four ...
2
votes
1
answer
7k
views
Converting each digit in an integer to its respective ASCII characters
For example what would be the process of converting the integer 1023 into ascii characters of
0x31 (1)
0x30 (0)
0x32 (2)
0x33 (3)
Not looking for any library functions (I know of Serial.print() and ...
0
votes
1
answer
116
views
Built-In Digital Map for Robot Driving
So, I'm creating this project for school. It's a simple robot with Arduino MEGA 2560 and basically, I create a digital map, feed it into the Arduino program and then the robot can drive. However, I've ...
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 (...
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 ...
6
votes
1
answer
8k
views
Compute yaw from magnetometer and accelerometer
I use an Arduino and a 9 DOF sensor (gyroscope, accelerometer and magnetometer) and I'm trying to use the pitch, roll and yaw that the sensor gives me to rotate an object in unity.
I managed to ...
3
votes
3
answers
3k
views
Algorithms to reduce measurement error from analogue sensors
When reading analogue sensors - e.g. load cells, accelerometers - via a microcontroller's Analogue to Digital Converter, there are many sources of potential measurement error including:
a) Warm-up ...
1
vote
2
answers
6k
views
Using I2C: Master Reader and Writer
I'm using I2C and the Arduino Library (Wire) to communicate between two Arduinos, and my code isn't working. It's supposed to read in an int from the slave, write a value to the slave, then read back ...
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 ...