Most Popular

1500 questions
4
votes
1 answer

Interrupts Within Critical Statements

I've redone a previous Arduino sketch I posted in which I was having trouble capturing encoder counts within critical statements, having no luck properly attaching and detaching interrupts. I've studied various ISR sketches but haven't been able to…
4
votes
1 answer

How to get variable from callback function?

There is a library davetcc / IoAbstraction. The only library working as expected with my rotary encoder. The problem that on rotation I can only see serial output with position data, but I cannot get these data as some variable value. There is the…
4
votes
3 answers

Programming Arduino Uno R3 to trigger a relay once every 24 hours

I programmed an Arduino Uno R3 to trigger a relay once every 24 hours from the moment it is powered on. I calculated milliseconds and used the function delay(). 24 hours * 60 minutes each hour * 60 second every minute * 1000 milliseconds every…
4
votes
1 answer

Arduino nano 33 ble vs ble sense. Power consumption, etc

After working with an Arduino Uno at work, I am looking to buy myself a board for some projects/experiments at home. The nano size seems like a great option, especially the one without soldered headers, as it is very flexible and easy to fit in…
qeiynn
  • 43
  • 4
4
votes
1 answer

What is the logic behind Arduino inlining `HardwareSerial::_rx_complete_irq()` for receiving serial data (but NOT `_tx_udr_empty_irq()`)?

Q: What is the logic behind Arduino inlining HardwareSerial::_rx_complete_irq() for receiving serial data (but NOT _tx_udr_empty_irq()), and when is it advisable? From the bottom of the HardwareSerial class in HardwareSerial.h: // Interrupt handlers…
Gabriel Staples
  • 1,385
  • 11
  • 27
4
votes
1 answer

ESP-01 does not run code after Deep Sleep

When using the deep sleep functionality on several ESP-01 boards, the boards require two resets in order to wake up properly (regardless of whether the resets are done by manually bridging the rst pin or by soldering a wire to do it from an…
sassoPera
  • 303
  • 1
  • 10
4
votes
1 answer

MEGA 2560: Simple program - One analogWrite turns off the other

I'm using Windows 10, Arduino 1.8.12 (Windows Store 1.8.33.0) I have an Arduino MEGA 2560 and a red LED connected to pin 4. #define RED 4 #define GREEN 2 void setup() { analogWrite(GREEN, 0); analogWrite(RED, 100); } void loop() { } This…
Mark
  • 197
  • 1
  • 1
  • 8
4
votes
3 answers

How compile an Arduino program for a desktop PC

I have an arduino program that only does serial communications with a little bit of math, and I am writing another one to communicate with it on a second arduino. For testing purposes I was hoping I could run the serial only program on my desktop. …
bob mcgrath
  • 55
  • 2
  • 4
4
votes
2 answers

AVR & PIC 8-bit Microcontrollers - Can you add: external flash memory, external RAM, video & audio output, more address busses?

so I was planning on creating a mini PC out of basic ICs and 8-bit microcontrollers such as ATTinys and/or PICs and I have several questions regarding those: Can you add external RAM, say with SRAM, DRAM chips, so the microcontroller can handle…
4
votes
2 answers

How to connect to MQTT broker with TLS?

I have ESP8266 which is connecting to MQTT broker and it is working ok using user+pass with following code: #include #include const char* ssid = "WIFINAME"; const char* password = "WIFI_PASS"; const char*…
iWizard
  • 143
  • 1
  • 1
  • 5
4
votes
4 answers

How can I set up outputs without using digitalWrite?

Consider the following: #define IN1 9 #define IN2 10 pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); void LeftMotor(Direction direction) { digitalWrite(IN1, direction == Forward ? LOW : HIGH); digitalWrite(IN2, direction == Forward ? HIGH :…
OrElse
  • 57
  • 1
  • 2
  • 7
4
votes
2 answers

Digispark clone not recognised when plugged in

When I plug in my digispark clone the computer doesn't make any sounds or some kind of acknowledgement that it has been plugged in. Anyone know why this may be or is it just a dodgy clone?
davidbrok5
  • 41
  • 1
  • 1
  • 2
4
votes
3 answers

Spiffs vs Eeprom on esp8266

In my project, i have some data to save permanently. After some research i got many examples and informations to do that with eeprom. I used it effectively. After all i decide to deep dive to esp8266 and i got some information about spiffs. Now i…
Dogan Cignakli
  • 95
  • 3
  • 11
4
votes
1 answer

Measure lipo voltage while powering arduino

I have a arduino pro micro 5V that I want to power with a 3.7V lipo. I also have a charging module to charge the lipo.…
Robbe
  • 109
  • 1
  • 1
  • 8
4
votes
3 answers

Powering the Arduino with a battery and reading the battery voltage

I am trying to display the battery voltage as it is being used to power the Arduino. I have tried powering the Arduino through the USB and the battery voltage is read accurately when compared to the multimeter reading. But when the battery is…
acho
  • 43
  • 4