The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

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

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


0

Now my code is working like I'm sending the data to Arduino UNO via serial(Keyboard) when it receive any serial data it scroll till 10 time and when (n>10) then will loop stop. In between this whenever I'm send any new data it is not accepting. what exactly I want ...


0

Forget using serialEvent(). It is one of the more stupid things that Arduino implemented. It is nothing more than a function that gets called (wrapped in a check to Serial.available()) once per iteration of the main loop() function. It is not really an "event" function at all. To have anything happen inside your while loop you have to manually implement ...


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


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


1

Serial data can only go to one place at a time. Either your Python program can receive the data, or the Serial Monitor can receive the data. Similarly the serial port can only receive data from one place at a time. So Windows prevents you doing something invalid by locking you out of the serial port when something else is using it. This is normal, and ...


0

Got a answer for the issue, Attaching code for anyone interested. /* Design by Vinod Amarathunga 26.08.2018 FSSG R&D Team */ #include <OneWire.h> #include <DallasTemperature.h> #include <SoftwareSerial.h> #define ONE_WIRE_BUS 2 SoftwareSerial mySerial(11, 10); //SIM800L Rx Tx char msg; String textMessage; bool D7_alarmSent = ...


1

There is already an answer and comment about possible hardware / flow control issues, so this answer is only dealing with your Arduino sketch. Iv’e added a couple of print statements and the FreeMemory library to test your sketch. #include <MemoryFree.h> String data = ""; void setup() { Serial.begin(9600); while (!Serial); delay(1000); Serial....


0

Check (e.g. with a multimeter) the DB9 voltages! Mostly RS-232 is used on those kind of connectors with voltages +-12Volts (there are other variants as well, up to 15V), but your Arduino's UART uses TTL levels (0V as logic low or 5V as high on a 5V Arduino). You'll need to convert these, possibly with a chip like MAX232 or similar. Also, for reverse ...


0

You do not need any hardware between the Particle and the router. Both the router and the Particle work at 3.3V logic levels. Connect the GND of the router the GND of the Particle Connect the TX of the router to the RX1 of the Particle Connect the RX of the router to the TX1 of the Particle You only need the MAX3232 if you want to connect direct to your ...


0

I am using processing.org for serial plotting from Arduino. It was the only app I could find that allowed me to make real histograms ( e.g. a million events in a hundred bins) and display various info numbers in addition to mean sigma for each channel. Two major problems: A) it turned out to be based on Java with no unsigned bytes B) synch ig with input ...


0

stty -F /dev/ttyACM0 ignpar stty -F /dev/ttyUSB0 ignpar IGNPAR Ignore framing errors and parity errors. That is what you need to fix minor framing issues. Screen switches this by default; but NONE of the serial drivers do. Especially when connecting PIs or BBB to Arduinos


1

int distance; int last_distance; // <== To hold the value from the previous pass int trig = 3; int echo = 2; void setup() { Serial.begin(9600); pinMode(trig, OUTPUT); pinMode(echo, INPUT); } void loop() { digitalWrite(trig, HIGH); delayMicroseconds(10); digitalWrite(trig, LOW); distance = pulseIn(echo, HIGH) / 58; if (distance != ...


0

You wrote: Serial.write(mySerial.read()); rc = mySerial.read(); Here you are calling mySerial.read() twice, and thus reading two characters from the port's input buffer. You then forward the first character through Serial, and process the second one. Note that you should normally not read two characters unless you have tested that mySerial.available() >=...


0

Back in the mists of time (late 1990s, if anyone's counting), there existed a file transfer protocol called XMODEM that was used to send a file across a link normally used for a terminal, on small, publicly available systems known as Bulletin Board Systems, or BBSes. XMODEM divided a file into packets of 129 bytes, sent and acknowledged one packet at a time. ...


0

Problem In essence, attachInterrupt uses a macro called ISR (stands for Interrupt Service Routine) to register a user provided function to handle an external interrupt event. The issue you are encountering is that ISR also wraps the call to your function with special instructions to clear the global interrupt flag of your microcontroller, and set it ...


Top 50 recent answers are included