Hot answers tagged

7

You are saving a String object in EEPROM, which is useless. A string object does not store the contents of your string. Instead, it just stores: the memory address where the actual contents (the characters) is stored the amount of memory allocated for this contents the number of characters that actually make the string This is what you are storing to, and ...


3

The problem is that a serial connection usually connects two devices, in your case it's three (sensor arduino, receiving arduino and your pc). To get around this you have to use an additional software serial on different pins on the receiving arduino (unfortunately the atmega328 has only one hardware serial interface). As long as you don't have to send ...


3

Just to have the full working code, I ended up with this: #include <EEPROM.h> char serial_characters[] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}; // 7 chars for serial and one for string end '\0' char serial_number[8]; void setup() { Serial.begin(115200); EEPROM.get(0, serial_number); // check found format if (serial_number[0] == 'S' &...


2

Connect the grounds of the two Arduinos together. Their serial transmitters and receivers need the same voltage reference. pinMode(A0, INPUT); is not needed. pinMode() only affects the digital part of the pin driver. (But it probably isn't doing any harm, either). The transmitter Arduino will be sending 1, 2, 3, or 4 ASCII bytes - the digits 0-9, ...


1

If you send "12" you send 4 characters/bytes: '1', '2' and a new line which is two characters: ('\r', '\n'). On the receiver side you check for two characters (not the new line), so you should take it into account. Actually, since you will eventually reach "100" you will receive 5 characters ('1', '0', '0', '\r', \'n'). So it is better to change the ...


1

The problem is that serial.write will block if the buffer is full. Only until the bytes get sent out through the TX pin. If I skip writing if the buffer is full, a receiver will only get old data on the first connect. No it won't. There is no "old" data. How can I replace data in the buffer or make sure there is only one dataset in the buffer? You ...


1

The ARM gcc libraries offer a simple way to redirect standard outputs. It is enough to implement function _write(int fd, char *ptr, int len) and it will replace the default implementation used in library to direct the standard outputs to debugger semihosting. The function must be compiled as C to match. #include <Arduino.h> #undef max #undef min #...


1

If your sketch has ... void setup() { Serial.begin(115200); // ... other stuff here; } ... And you run the IDE serial monitor at 9600, you will get gibberish. The same happens the other way round. You need to match the monitor to the baud rate you've defined on the Serial.begin(); call.


1

The issue is that the Serial port on the ESP32-WROOM setup is not like like on the Arduino. It seems that the initialisation will 'miss' the USB enumeration after reboot. To fix this add a delay in your setup() function of 10 to 15-seconds before initialising the serial. For example: void setup() { delay(10000); Serial.begin(115200); Serial....


1

Can I use a ATtiny85 board (eg Digispark) as a USB CDC device? Yes! If I have got this right, to be able to communicate with a USB serial device you need to have USB CDC support and if you want it to fake a keyboard/mouse you need HID. The Digispark have a CDC library https://digistump.com/wiki/digispark/tutorials/digicdc But it has its limitations, take ...


1

In short, I ended up creating a library capable to drive multiple DShot600 ESCs: DShot-Arduino It still need a lot more polish, but the bit-banging works really well. SPI method I tried the method @dannyf mentioned, which involved combining 3 SPI bytes to form 1 dShot bit and it actually works. But there's a few problem with SPI: It takes up the ...


Only top voted, non community-wiki answers of a minimum length are eligible