Skip to main content

Questions tagged [loop]

Filter by
Sorted by
Tagged with
0 votes
2 answers
166 views

The code below has a normal bright led on the 5th pin of port F while those on port B, 0, 1, 2 are dimmer. Even if you hold down one button and a moment later simultaneously press another button while ...
NaturalDemon's user avatar
0 votes
1 answer
85 views

I am trying to brute force a CANBUS with ID's and values but my loop doesn't seem to change the ID. I am expecting the following when changing ID's 0x100 FF FF FF FF FF FF FF FF 0x101 00 00 00 00 00 ...
maxum's user avatar
  • 145
1 vote
2 answers
98 views

I made code to make 2 servos work. the sequence of working is to make the servo 1 start rotate 2 cycles then stop and the second servo start rotate for another 2 cycles then detach both of them. I ...
Salma's user avatar
  • 11
1 vote
1 answer
218 views

I'm using an Arduino Due to make a feedback loop using python, but this does not seem to function. The python code I'm using is the following: from serial import Serial board = Serial('COM11',9600) ...
celestin's user avatar
-1 votes
1 answer
45 views

i'm trying to create a program that given a configuration (i've used multiple struct nested) i need in loop() to check for each output if they need to be on or off and set the output accordingly let ...
Darkmagister's user avatar
1 vote
2 answers
130 views

I am trying to write a program which takes in a number of pairs to be multiplied, then prints out the result of each multiplication. Instead of doing this, the program just prints out the number of ...
JG98's user avatar
  • 21
0 votes
1 answer
303 views

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){...
LB Burkhardt's user avatar
1 vote
0 answers
89 views

#include <IRremote.h> #include <Adafruit_NeoPixel.h> #define LED_PIN 7 // define the LED strip data pin #define LED_COUNT 150 // define the number of LEDs in the strip Adafruit_NeoPixel ...
Martin's user avatar
  • 11
0 votes
1 answer
181 views

I am developing a hangman game on tinyduino(tinycircuits) and I am currently stuck on how to properly replace a char based on user input within a for loop. My current code does actually replace the ...
Isaac Agatep's user avatar
2 votes
1 answer
164 views

Just started out with tinyduino(tinycircuits) and I am trying to develop a hangman game. I have this chunk of code that randomly picks a word from my array. I've omitted some code for readability. ...
Isaac Agatep's user avatar
-1 votes
1 answer
152 views

I wanna write a program for rc-plane navigation The plane must navigate to 2 waypoints waypoint_1 & waypoint_2 When it reaches to waypoint_1 (with miss-distance =< 5) then navigate to ...
Curious guy's user avatar
-1 votes
2 answers
367 views

When I run this code, my pin and pinCheck arrays are not being filled with the results of keypad.getKey(). If I print the value at each index, the result is blank. As far as I can tell, I am either ...
Ryan's user avatar
  • 3
1 vote
2 answers
2k views

I am trying to implement the simplest circular buffer in Arduino. I think I am able to implement it because my push and pop functions do not return any errors. However, when I want to print the data ...
TheClem's user avatar
  • 11
2 votes
2 answers
713 views

I have a simple arduino project with 5 leds, the project should start with led 1 fade through 50 millisec to reach full brightness, then led 2 and so on until led 5 then turn them all off and loop. ...
AhmedH2O's user avatar
  • 123
-1 votes
1 answer
73 views

The first time, pow() works. But inside of a 'for loop', or again afterwards, it doesn't behave !? (I'm using a Chinese Pro Mini with Arduino 1.8.16) EDIT To clarify what I am asking, my question is:...
TRS-80's user avatar
  • 21
3 votes
2 answers
2k views

Im a complete beginner. Generally speaking, is there any need at all to have a delay in the main loop()? Im not used to writing infinite loops 😀 Is it correct to say that the delay() command is ...
user avatar
5 votes
3 answers
2k views

So, I've just started programming Arduino (and also in general), so I'm doing basic things, like switching on and off LED's. I've made them light in a sequence and then turning them off (in the same ...
AndreFro's user avatar
2 votes
2 answers
214 views

So I'm a beginner at Arduino and I have to light up an LED grid to show digits from 0-9. I wrote a bit of code (with the help of some people) and it's like 90% done but there's this ONE problem. I ...
BertjeDP2000's user avatar
1 vote
1 answer
935 views

I am designing simple "Simon Says game" using Arduino. Simon says is a game in which a LED pattern is played and user has to mimic the pattern. There are 10 Rounds. First Round = 1 led, ...
Snoke's user avatar
  • 23
0 votes
1 answer
149 views

I am using the Arduino Nano every. Take this example where I am measuring two things A and B. Loop{// this loop runs once every second //Read A,B //Change something using analogueWrite which ...
fred's user avatar
  • 101
0 votes
1 answer
41 views

An Arduino Nano is set up to perform A/D conversions and send results out over Serial. Currently the code structure is like loop() { delayUntilNextTargetTime(); measure(); ...
Harald's user avatar
  • 133
2 votes
1 answer
172 views

I'm trying to simulate dynamic temperature using a small set of data with ESP32. I've just realized that the relay doesn't change the status if there is some variation of the temperature upper or ...
s_tatus3's user avatar
1 vote
1 answer
598 views

I have a problem with a for loop, and Serial.print("Its Working") does not appear. Seems simple, I've done it before, now for whatever reason, its not working anymore void setup() { // put ...
Coder9390's user avatar
  • 512
2 votes
3 answers
918 views

I have a problem with getting my buzzer to only do the tones I programmed in once. I know I have to add some sort of code but I'm relatively new to this so I don't really know. I want it to start ...
Éemia's user avatar
  • 33
1 vote
2 answers
471 views

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 ...
Juan Antonio's user avatar
2 votes
1 answer
135 views

//Here is my code so far int speakerPin = 9; int length = 28; char notes[] = "GGAGcB GGAGdc GGxecBA yyecdc"; int beats[] = { 2, 2, 8, 8, 8, 16, 1, 2, 2, 8, 8,8, 16, 1, 2,2,8,8,8,8,16, 1,...
William Woodard's user avatar
1 vote
1 answer
188 views

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 ...
Asif's user avatar
  • 11
0 votes
1 answer
81 views

Basically I have three push buttons that correspond to pins 1 to 3 and want to set an efficient code that sets a certain variable into the index whose digitalRead is equal to one. Let us assume that ...
AndroidV11's user avatar
0 votes
1 answer
106 views

I have this project with my Arduino UNO where I want my servo motor SG90 to go full speed to 180 degrees when the PIR sensor sends HIGH value and go slowly back to zero when the value is LOW. I have ...
Nathan Ghali's user avatar
1 vote
0 answers
99 views

Hi I'm making a digital fare meter, I have a problem in how my sensor reads when I'd pressed the button(single tap). I need the sensor to read once I pressed the button because when I press the button ...
SkilleX's user avatar
  • 11
1 vote
0 answers
433 views

I am using the receiver RDA5807m, but I do NOT need to switch the frequency and other parameters during operation. I noticed that the module continues to work when the programming pins are ...
Антон's user avatar
1 vote
0 answers
95 views

I have a piece of code that captures input from infrared and spits it out to the serial port. When I use it with a simple controller that comes with a typical kit, it receives the infrared code just ...
brad's user avatar
  • 201
0 votes
1 answer
147 views

I want to provide a delay in the following iteration reading so that the sensor can read the condition after the pump starts. void loop() { //-------------Fungsi Read sensor----------- // ...
daffa faiz's user avatar
1 vote
2 answers
190 views

I'm making an interface that will have a digital clock....once a second.. I'd like to do other things at different intervals but if I delay(1000) then I have to wait that second which is now the ...
BostonAreaHuman's user avatar
1 vote
0 answers
199 views

i'm using fuzzy to decide how long the relay on pump on and i got some trouble for it he just looping on relay how should i do thats my code //---------Fuzzy 2.1 prelauch---------- //-----iNPUT ...
daffa faiz's user avatar
1 vote
1 answer
211 views

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 ...
FlipFlop's user avatar
1 vote
0 answers
66 views

Here is the code I've written so far. I am making a circuit with a couple of motors and 3 sensors. My plan is for the PIR Motion sensor, distance sensor, and photoresistor to tell the motors to stop ...
Guest's user avatar
  • 11
2 votes
0 answers
76 views

I am very new to Arduino and coding/programing. I set a task for myself to make a simple circuit of 5 LEDs controlled by pins 2, 4, 8, 11, 12. I want to be able to make two different pattern for the ...
Tayler Hasson's user avatar
2 votes
1 answer
102 views

I'm writing a choose-your-own-adventure style project for a class project. My Arduino Uno is set up with a 16-digit LCD display and two pushbuttons with pulldown resistors. I'm wanting each function ...
Snyper's user avatar
  • 41
0 votes
1 answer
12k views

Is it possible to let a LED blink, for example 5 times, with an Arduino? Should I use a for loop? Something like this works in setup, but it will run continuously in the void loop, so my LED keeps ...
Niles's user avatar
  • 123
1 vote
1 answer
77 views

I've been working on a level meter with a neopixel strip (WS2812). The code is very simple: reading a potentiometer, mapping the input and showing the output in the led strip. So far, so good. The ...
Vidal's user avatar
  • 13
1 vote
1 answer
329 views

I would like help to continuously loop over my output pins after each sleep cycle. I am trying to increment through each output pin during each successive interrupt. Introducing this myIteration ...
chirp84's user avatar
  • 21
1 vote
4 answers
3k views

Can anyone send me a link tutorial about Arduino Object Oriented Programming? I want to learn Arduino, I am just a beginner.
Time Gold's user avatar
  • 103
2 votes
1 answer
168 views

#include <ESP8266WiFi.h> const char *SSID = "mr_lazy_boei"; const char *pass = "usalusal"; WiFiClient client; // Relay pin number int ignition=2; int self=0; // Return ...
Mohd Usal's user avatar
1 vote
1 answer
552 views

Okay, so I am making a jewelry box for my niece that will spin a necklace holder with a stepper motor, play an audio file and turn on LED lights. I am using an Arduino MEGA 2560. The flow is this: ...
Vincent Ledbetter's user avatar
1 vote
3 answers
2k views

Ive been staring at this for a while now and I am going cross-eyed. I am writing a simply program to change colors of a 3 color LED. It is working, but then I noticed the LED would sometimes flash. ...
Keltari's user avatar
  • 163
1 vote
0 answers
69 views

static const int dry = 570; static const int wet = 225; static const int RELAY = 2; static const unsigned long DELAY_1_S = 1000; static const unsigned long DELAY_1_MINUTE = DELAY_1_S * 60; static ...
Patrick Vibild's user avatar
1 vote
1 answer
237 views

I am using the Arduino's Adafruit Finger Sensor library, and it has an example to enroll a fingerprint. I want it to enroll one print and exit/break out of the loop because it currently enrolls a user,...
Ngugi Kariuki's user avatar
1 vote
1 answer
45 views

I'm new to this, so, please, don't crucify me. I have a function that checks if an entry in multilevel array is in a certain range. Using FOR loop I check the whole array with this function, which ...
Martin Keller II.'s user avatar
1 vote
0 answers
788 views

I have started a thread on the Arduino forum. If someone could have a look at the thread and give me some help either here or there that would be great. (I don't want to have to add all the ...
jburke424's user avatar