Hot answers tagged

3

The SSD1306 uses a lot of RAM. Pretty much all your RAM. Serial also uses quite a bit of RAM. The two struggle to work together. There is a special "text only" SSD1306 library that uses considerably less RAM: https://github.com/greiman/SSD1306Ascii


3

We cannot know, if your python code also has a problem. But your Arduino code will send the series of "V" only once. You are using this while loop: while(counter < maxnum) in there you are incrementing the variable counter. But after you left the while loop, you are never resetting counter to zero. So the next time, counter is still equal to ...


2

Reading and writing of serial data are separate functions. When you .write() you just append the data to the TX buffer. When you .read() you just take the next character from the RX buffer. All actual sending and receiving, and filling/emptying of the buffers is done inside the ISRs for the UART module. That said, you really shouldn't use Serial inside an ...


2

I had the same issue. After entering command that Majenko suggested: stty -F /dev/ttyUSB0 -hupcl I still wasn't able to send commands to Arduino nano. Strangely, when I open Arduino IDE Serial Monitor and send command it works. When I close it, I can send commands in terminal to Arduino for some time. Then it stops working again :/


2

Just adding a little flesh to @chrisl's excellent answer with some added technical detail: B) Some Tutorial mention that using a voltage divider create some communication interference. It is true and/ relevant for use as explained ? The problem here is that the resistors and the input pin's capacitance form a low-pass filter. Too high a resistance and you ...


1

Thank you Majenko... It was low RAM problem. SSD1306 takes 1K, with MPU6050 the and serial print which I have included the remaining RAM is 5 bytes only, hence the initialization issue. I followed simple guideline to reduce RAM footprint Read this thread https://stackoverflow.com/questions/8649174/checking-memory-footprint-in-arduino Code to print available ...


1

This buildin LED is connected to an IO pin of the microcontroller on the Mega (most commonly pin 13, but might be different depending on the board). So the meaning depends on what the code on the Mega does with it. When the board is reset (which happens on opening of serial connection), first the bootloader will run. It gives you a short blink on the buildin ...


1

A) Does Rx Tx need a voltage to be the same ( some on-line tutorial ignore this at all )? if so, is it needed both ways ? The point is, that often 3.3V MCUs cannot tolerate voltages significantly above that. So connecting 5V can hurt it. I've seen quite a bit of discussion online, if ESP boards are 5V tolerant or not, but I haven't seen a real investigation ...


1

Generally you should not provide power to any pin of a device, which is powered off. That can cause current flowing through clamping diodes to ground and might destroy the pins hardware or the device (also it can lead to weird situations, where the device is somewhat powered through the IO pin, which might lead to instability). You can either cut the ...


1

The over-arching concept is Object Oriented Programming (OOP). The terms I was taught at University - taking Serial.println() as an example: Serial is an instance of a class (in this case HardwareSerial), sometimes called an object. println() (a function in a class) is a method of a class. A "variable" in a class is called a property of a class. ...


1

Nothing wrong with your code, I've the exact same issue as you have. It bothers me whole week long and fortunately, we (along with my colleague) accidentally figured that was caused by Windows 10, weird right? We don't believe it at very beginning either, but after several back-N-forth testing, it just like that. When we upload exact same code from another ...


1

If you want a quick, cheap, and easy solution, you could just use sleep() in your Python script to put a delay between the commands. This obviously isn't a perfect solution, but it's not difficult to implement. Or, like you said, you could use a delimiter. It's not as easy to implement, but it'll work better. If you go the delimiter rout, you'll probably ...


1

Sir mane ardunio mega 2560 my programing k hy jo k different sensor k value lake display karty hy aur sir ab my us value ko server jo k thingspeak hy aus p bajna chahta ho sir aus k leye mane esp8266 node-mcu use kar raha ho to sir ab my chahta ho k arduino value lake node-mcu ko send kary aur node mcu phr server p sir in k leye serial communication chahyae ...


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