New answers tagged

1

I think it is because of power consumption. If the LEDs consume lots of power, the LED on Arduino(typically mini red LED) will be off or faded. So before you connect the LEDs, check the mini red LED which is on Arduino and after connection the LEDs, check ones again. If the red LED is faded or off, the problem must be power consumption. Connect 12v or 5v ...


2

This comes up ALL THE TIME. Don't use delay. Do a Google search on "arduino blinkwithoutdelay" and read one of the various write-ups on the subject. Here's a writeup that looks pretty good: https://learn.adafruit.com/multi-tasking-the-arduino-part-1/using-millis-for-timing


0

you have to set the PRR timers on start: lds r16,PRR andi r16,0b10010111 ; PRTIM2 | PRTIM0 | PRTIM1 sts PRR,r16


1

My solution: uint16_t st_led=0; uint16_t et_led=0; while((TIFR1 & (1 << OCF1A))==0) //30 second { st_led=TCNT1; et_led=st_led; while((et_led-st_led)<=15624) //1 second { et_led=TCNT1; } PORTA ^= (1<<ledno); } TIFR1=(1<<OCF1A); TCCR1B=0;


1

Just found this: https://forum.arduino.cc/index.php?topic=311099.0 Turns out you can use the analog pins of an Arduino UNO using this: pinMode(A1,OUTPUT); digitalWrite(A1,HIGH); You just have to list it as an analog pin. Seems to be working, don't think there are any downsides, as far as I see.


3

You may be finding Connect to LCD via I2C, default address 0x27 (A0-A2 not jumpered) confusing. These refer to the I2C address selection lines of the IO expander (the PCF8574T) used on the I2C LCD display and not to the A0-A2 analog pins of the Arduino itself. The note // Wiring: SDA pin is connected to A4 and SCL pin to A5. is referring to the analog pins ...


0

If read-counter is already incremented once a millisecond, use that to time your LED flashes: void wait_function() { timer_init(); bool LED_State = LOW while(read_counter()<30000) { //30 second wait // A LED blinking at 1 second intervals ??? if (read_counter % 1000 == 0) { //Switch 1000 to 500 here if it flashes too slowly LED_State =...


1

Your waiting loop runs much faster than once per millisecond, and even faster per second. So to get just one "event" per second, you need to detect the change of the second. void wait_function() { timer_init(); for (int second = 0; second < 30; ++second) { // 30 second wait // Wait for the next second int old_second = read_counter() /...


1

No. You will destroy the Arduino and the bluetooth module. Firstly the Arduino needs no more than 20V absolute maximum - recommended no more than 16V. Secondly a resistor is not a voltage regulator. It can only drop a fixed voltage when you have a fixed current. It only works with LEDs because they are themselves a fixed voltage. Thirdly an Arduino output ...


4

There are 3 LEDS on the Nano 33 BLE: A power LED on pin 25 (yes, you can turn off the power LED programatically); A built-in LED on pin 13; An RGB LED with red on pin 22, green on pin 23, and blue on pin 24. In the variant file, they are given names: #define PIN_LED (13u) #define LED_BUILTIN PIN_LED #define LEDR (22u) #define LEDG (23u) #...


1

After spending way too much time on the code, I figured that it had to do with something entirely different: The RFID reader created an RF interference on the data wire towards the LED strip... Shielding it properly did the trick, no matter which pin is being used. Thanks for the help anyway.


1

One simple solution could be: Start by noticing the first time you get the HIGH input whit a simple if statement: if (digitalRead(sensor) == HIGH) { } where sensor is the pin of the sensor according to your code. When this statement is True, you are interested in remain here until one of two things happens: either you interrupt some kind of loop with ...


0

Or what about adding another global boolean; bool firstTime = true; and then amend you loop() code as follows; if (digitalRead(sensor) == HIGH) { if (firstTime) firstTime = false; else { sensorMillis = currentMillis; ledstate = true; } }


Top 50 recent answers are included