All Questions
8 questions
0
votes
1
answer
239
views
if statement does not work with fraction, but works with decimal equivalent
I'm trying to trouble shoot a problem with my code and narrowed it down to my if statement not working with a fraction.
The below code does not work and returns 0
for(float i=0; i <= 1; i += .0001){...
1
vote
2
answers
420
views
How do I pause a loop just once?
I´m trying to make a pause in a loop, but just for the first time it loops. The next loops i would like the program to NOT do the pause. Just once time, each time a button is pressed. Does anybody ...
1
vote
1
answer
161
views
Rotating Servo Motor using Arduino
Using arduino, I'm trying to rotate a 360 servo that will move clockwise 5 seconds,pause and counterclockwise for 5 seconds and then completely stop. However, my servo just continuously keeps on ...
1
vote
1
answer
168
views
Storing and sequencing output value (Arduino)
I am new to Arduino programming, after days and nights trying to use array and for loop, and googling a lot of articles, I am still unable to find how to store each weighing output value from int ...
0
votes
2
answers
489
views
Is there a way to make a function take an exact number of clock cycles?
Is it possible to use something like a compiler directive to pad a function with do nothing instructions so that as you add lines of code or take them away it always executes in the same amount of ...
-1
votes
2
answers
3k
views
How do I run a function every 10th time through a loop?
I currently have a function that poles all my sensors every time through it's loop, but I want to pole one of the sensors only every 10th time. Currently there is a 10 millisecond delay at the ...
0
votes
1
answer
351
views
How can I assign a variable to a function output in Arduino?
I'm trying to assign the output of my function (which adjusts a DAC output) to a variable so I can print and display it in my serial monitor. Here's the code
#include <Wire.h>
#include <...
1
vote
1
answer
75
views
Class help - Same Object types seem to mix values with each other
I'm having issues with two objects of the same class type. I have a LED class, which has functions to fade in and out, a LED. In my code, I create two objects of this class, and on the board, I fade ...