New answers tagged

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 ...


0

That's some strange Intel monstrosity. It's impossible to know what it does or how. Intel's foray into the Arduinosphere was brief and somewhat abortive. In general though (for most cores) the DTR signal (and sometimes the RTS signal too) of the CDC/ACM protocol is used to "gate" the serial data - if it's asserted then serial data gets sent through ...


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 ...


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 ...


0

OK, so I resolved this problem, but only half-way. I was using NodeMCU with CH340 ... and this controller worked only in Serial Monitor, not in command shell on one computer (it worked fine on other computer). So I tried using different NodeMCU with CP2102 and it worked just fine. So I assume there must be some kind of issue with ch341 driver in my linux, I ...


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 ...


0

You are writing "62.1" but you are trying to read up until a \n, which you never send. You need to ensure that you send the end-of-line character that you subsequently check for, fwrite($port, "62.1\n"); Also it's worth noting that floating point values are only ever an approximation. They're great for doing calculations, but very poor ...


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 ...


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 ...


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. ...


0

Well had a bit of luck after spending all day on this. Arduino UNO (sender): Like mentioned by chrisl, use Serial.write and not Serial.print mySerial.write(sonar.ping_cm()); UNO Wifi (receiver): Serial.println(mySerial.readString()); So, instead of mySerial.read I used mySerial.readString. This is most likely a obvious mistake to almost everybody here; ...


-2

#include <LcdKeypad.h> #include <LiquidCrystal.h> #include <Wire.h> // For I2C //Set the pins on the I2C chip used for LCD connections //ADDR,EN,R/W,RS,D4,D5,D6,D7 LcdKeypad lcd(0x3f, 2, 1, 0, 4, 5, 6, 7); // 0x27 is the default I2C bus address of the backpack-see article #define echoPin 3 // Echo Pin (OUTPUT pin in RB URF02) #define ...


1

Consider the following: char buffer2[16]; // array of 16 chars for (uint8_t i = 0; i < 16; i++) { do_something_with(buffer2[i]); // handle one char at a time } Here we have an array of 16 cells, each having the char type (which I assume is what you have). The loop goes through the array, handling one cell a time. Within the loop, buffer2[i] ...


Top 50 recent answers are included