Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [calculation]

The tag has no usage guidance.

-2
votes
1answer
43 views

What should the cut-off frequency be? [closed]

To convert a PWM signal to a DC voltage it must be filtered with a low pass filter. How can you know which cut-off frequency should be used and how do you calculate the values for the resistor and ...
0
votes
1answer
27 views

How to map integer values and round to a count of tens/thousands?

I'm mapping a potentiometer from 0-1023 to 1000-120000 (1 sec to 2 minutes) for a timer, like: maxDelay = map (pot2, 0, 1023, 1000, 120000); Both variables are integers. Now I would like to convert/...
1
vote
3answers
122 views

How to filter or eliminate earths magnetic field readings around 3D Magnetic sensor?

Im using the SparkFun MAG3110 3D sensor: https://www.sparkfun.com/products/12670 My application is essentially to make a contactless "magnetic joystick" using a local magnet for accurate and constant ...
0
votes
2answers
126 views

Using modulo for negative values

I want to wrap a random number using modulo, so that values exceeding 11 starts over from 0 and greater. However, i would also like numbers less than 0 to dividend 11 or less. Please correct me if i'...
0
votes
2answers
458 views

C++ Adding Two 16 bit binary numbers together

I am trying to add two 16 digit binary numbers together. Each binary number will have been entered by the user and saved as: int binaryOne[16] and int binaryTwo[16]. Originally, int binaryOne[16] = {...
2
votes
1answer
601 views

How to calculate actual Baud Rate and its percent error?

I am using an Arduino Uno, and I need to create a program that calculates the actual baud rate and the percent error for all standard baud rate in Arduino monitor program.
1
vote
2answers
70 views

When i press a button to subtract 1 from 5 it skips to 3

When i press a button to subtract 1 from 5 it skips to 3, it's the same when I add 1 to -5 it skips displaying - 4 and goes straight to -3. This is the code that i am using: //Testing the use of ...
-1
votes
3answers
62 views

How do I create boundaries for the possible values of an integer? [closed]

I want to create an integer whose total value cannot go beyond a range of numbers when added to and subtracted from. For example, if the "total_value" started at 0 (of a total possible range between -...
-3
votes
2answers
1k views

How to calculate step delay? [closed]

I'm struggling with get suitable step delay while driving a stepper motor. How to calculate exact step delay for 1.8deg/step stepper motor? Give some example calculation.
2
votes
4answers
5k views

Reading pressure sensor using Arduino analog

I'm using a Arduino Uno to read pressure and I want to know if I have wired/coded the sensor correctly. I'm not sure I'm getting the correct readings (it could be the right readings - I just want to ...
0
votes
1answer
290 views

Unsigned long overflow? Or something else?

I have been looking at this for hours and can't figure it out... Take the following code I ran on an Arduino Mega: #define MINUTES 0 #define SECONDS 1 #define MILLIS 2 #define ...