Most Popular

1500 questions
4
votes
3 answers

Memory usage: #define vs. static const for uint8_t

I'm writing an Arduino library to communicate with an I2C device, and I'm wondering what the best way is to declare all the register addresses so as to save memory. Using #defines: #define REGISTER_MOTOR_1_MODE 0x44 #define REGISTER_MOTOR_2_MODE…
4
votes
2 answers

How to converte EPOCH time into time and date on Arduino?

I have a question on how to convert EPOCH timestamps, which I receive as char*, into DD.MM.YYYY and HH:MM:SS format separately? Here is more information on my Arduino project: The Arduino is receiving through an ESP8266 module three different EPOCH…
imax10000
  • 43
  • 1
  • 1
  • 3
4
votes
5 answers

Simultaneous button reading?

I'm currently working on a project that requires that I simultanously check the state of two buttons. Each button HIGH state is assigned to one if loop. Here's the basic concept: void loop() { S1_State = digitalRead(S1_Pin); S2_State =…
4
votes
2 answers

Divide two integers resulting into a float

Suppose I want to divide two integer variables and put the result into a float. In order to prevent integer division do I have to program like this: int i = 6312; int j = 258; float f; f = i; f = i/j; Or can I straightforward…
PimV
  • 443
  • 1
  • 4
  • 12
4
votes
3 answers

Get ESP32 Chip ID into a string variable (Arduino/C++ newbie here)

It's just a few days since I started using Arduino IDE ( programming an ESP32 ). As I learn, I am trying to write some snippets. I wanted to store the Chip ID of ESP32 into a variable (preferably string?) so that I can generate an unique device…
R.W
  • 155
  • 1
  • 1
  • 7
4
votes
4 answers

How to package a 16 bit integer to send it with serial.write?

I am trying to display the values i get from reading a potentiometer (0-1023) in the program called 'processing'. when I just use Serial.write(integer) and display the value on a line graph in 'processing' the line will max out at 256 and loop back…
Tom
  • 59
  • 1
  • 1
  • 3
4
votes
2 answers

How are errors (not related to syntax) managed in arduino and in the AVR architecture in general?

I was just curious about how the AVR architecture manages errors that would cause a regular desktop program to crash. I'm talking about logical errors for example math problems that are undefined. Such as division by 0 and getting a square root of a…
Coder_fox
  • 686
  • 7
  • 14
4
votes
2 answers

Connect to ch340 on MacOS Mojave

I recently upgraded my MacBook Pro to Mojave. Now I'm not able to connect to my Arduino board with ch340g usb-to-serial chip. It is a Arduino board with AtMega 328 and ESP8266 integrated. I downloaded the drivers from the Chinese website for the…
Sven
  • 221
  • 1
  • 2
  • 7
4
votes
1 answer

ESP 12 unusable pins

The ESP 12 board has 22 pins Are all of them usable? I understand that there is an external flash memory that is accessed through SPI, but I'm not sure what the impact on the pins is. And if it is so, then why are the pins available? Is there a…
4
votes
1 answer

Unable to upload sketch using Platformio (but Arduino IDE works)

I am using an Arduino Nano (Clone) which I was programming with the Arduino IDE (Version 1.8.5 on Mac OS X 10.10.5). Using the Arduino IDE I need to re-plug the Nano before uploading, but after doing this everything works as expected and the sketch…
albert
  • 205
  • 2
  • 13
4
votes
3 answers

Arduino IDE 1.8.6 not starting.

My Arduino IDE is not getting started. It just crashes before opening up. I don't know what the problem is. It was working well enough before without any issues. This is what I see after running the arduino_debug.exe in the command line Note: I…
Jaymeen_JK
4
votes
5 answers

How to convert byte *payload to String

I would like to convert a byte *payload to a String, because I want to compare the content of payload to another String. void mqttCallbackHandler(char *topic, byte *payload, unsigned int length) { String payloadstr = ??? ... }
Dániel Kis
  • 175
  • 1
  • 3
  • 9
4
votes
4 answers

Send out a short signal every 10 seconds to an arduino

In order to reduce power consumption, I want to resume my Arduino from standby mode every 10 seconds. For this a hardware interrupt is necessary. Is there such a device that can create a quick impulse to trigger that interrupt? It can be anything…
Cowboy_Patrick
  • 174
  • 1
  • 16
4
votes
1 answer

ESP32 AP max connections: 4 or 10?

I am using the SoftAP feature of the ESP to create a central node, and connecting five or six clients in the final application. However, I don't know if i can connect that many clients. One of the core files on GitHub, esp_wifi_types.h shows two…
CharlieHanson
  • 1,430
  • 1
  • 11
  • 25
4
votes
1 answer

3.5 inch TFT LCD connection diagram with mega r3

Forum post I would like to ask if someone has this shield fully working? My biggest problem is the touch screen that I couldn't manage to make work. Here is the code I am using: // ic: ili9327 #define LCD_RD A0 #define LCD_WR A1 #define…
ardutech
  • 41
  • 3