New answers tagged

0

Many, many times I have had to travel to a site to set the VFD input channel to "Network" as its default is often DIO controls. Check the VFD is listening to the ModBus Comms.


1

I installed a library from within the IDE as StarCat suggested. https://github.com/Makuna/Rtc #include <FastLED.h> #include <ThreeWire.h> #include <RtcDS1302.h> #define NUM_LEDS 50 #define DATA_PIN 6 ThreeWire myWire(3,4,2); // IO, SCLK, CE RtcDS1302<ThreeWire> Rtc(myWire); CRGB leds[NUM_LEDS]; void setup() { FastLED....


1

You can use the one provided by generating it with STMCubeMx. This is going beyond arduino though. But it is highly feasible.


0

SoftwareSerial is only a "good" choice (for certain values of "good") if you only use one instance, and that is the only serial port in the system. Using SoftwareSerial to read from 2 ports simultaneously is not possible. Using SoftwareSerial to read data in tandem with any other hardware serial ports will result it data loss. SoftwareSerial is only any ...


1

For what it's worth, I manage to make them working again by playing a bit with the settings of both modules. Using a simple test sketch I issued some AT commands to both modules; I had already tried setting them to the DEFAULT setup with AT+DEFAULT, but that was fruitless. I decided to left the mode as is (FU3), same for the serial rate (B9600), but I tried ...


1

SoftwareSerial can only listen to one port at a time. You cannot listen to both, no way. To really listen to both, you need an Arduino with more hardware Serial ports, where most of the protocol is done in hardware, thus can receive without CPU intervention. The Arduino Mega has 4 hardware Serial ports. Or you could impose a protocol on the Serial stream to ...


1

You are not reading the GPS often enough. The method Adafruit_GPS::read() is documented in the comments embedded in the source code: Read one character from the GPS device. Call very frequently and multiple times per opportunity or the buffer may overflow if there are frequent NMEA sentences. An 82 character NMEA sentence 10 times per second will ...


0

The baud rates, voltages, and timing all have to match up for serial communication to work right. So, set both of your devices to the same baudrate (you specify the number in Serial.begin()), and ensure they're connected properly. (voltages match, TX to RX, and ground is connected) You can just read/print the serial input to the arduino with something like ...


1

I cannot really narrow down the source of your observed problems, since the problem descriptions are not clear enough. But there are some obvious problems/potential for making it better in your code. In the Uno Code: It is totally unnecessary to use a timer interrupt for reading the SoftwareSerial interface. Instead you should write your loop() function ...


0

I think I may be able to help clarify things a bit here: You are not trying to "flash" the ESP01 (the kind you have) board, but you are trying to talk to the AT command firmware it came installed with. Also, there's a sort of pingback sketch (I forget the name and can't find it, but it basically uses a SoftwareSerial and copies characters from one to the ...


-1

parallel communication is possible using arduino you need to use the ports for example port A and then a rx tx pins. Here we set up the two ports DDRA and DDRC to be output ports by using the mask B11111111; We set the interrupt pin to port 44 and set it is an output and we set the receive pin to be 45 and an input. Then we call transmit in the loop. ...


1

The wrong thig with option 3 is the buffer length, you should use snprintf instead. The other problem is that first you build the string, then you print the output, the program traverses the string twice. Option 2 creates object from string, then applies + operator to create a new string, then prints it - it is comfortable with short strings, but least ...


0

https://www.arduino.cc/en/Reference/softwareSerial Because 115200 band was also the fastest communication enabled by the software serial.


1

You can indeed simultaneously read and write through the serial port. At the hardware level, the serial port (the UART) is a transmitter and a receiver, which are almost independent. At the software level, they are both handled through interrupts that read from / write to a software buffer. There is, however, a limitation you should be aware of: the ...


1

1.prefer using Serial.readStringUntil(); OR Serial.readString() that way its much easy to manipulate. 2.use a static variable in loop function which stores the string or use a global variable to save char array tagString1 before going in println function same goes with the second reader that way the println will show the previous scan until a new scan is ...


2

I would use a programming concept called a state machine. For example an integer variable called State could be used to track the current status which could for example be WAITING_FOR_DATA or RECEIVING_DATA or DATA_COMPLETE and only print when DATA_COMPLETE. I'm sure there are plenty of examples you could find with an appropriate search.


0

OK so here is my solution. I made a wrapper class called SafeSerial. In SafeSerial.h: #pragma once #include <Arduino.h> class SafeSerial : public Serial_ { size_t write(const uint8_t* buffer, size_t size) override; }; In SafeSerial.cpp: /* * SafeSerial implementation for Arduino Leonardo. * Overrides the Serial_::write() method and ...


1

You may be able to sniff the communication from the Raspberry Pi itself, with no extra hardware. Assuming the program on the Pi can be configured to use a serial port other than /dev/ttyACM0, a sniffing program could create a pseudo-terminal pair, then forward data back and forth between /dev/ttyACM0 and the master pseudo-terminal, while logging everything. ...


1

As st2000 stated in the comments, tapping on USB is a complex task and certainly not the way to go. Maybe there is a program for Raspbian, that pipes the Serial data to 2 programs simultaneously. (I don't know one and that would be off topic here) So your best way would be to tap the Serial (UART) communication between the USB-Serial chip (which translates ...


1

If all you want to do is monitor what is going on then you can take a pair of USB to UART adaptors and connect the RX pin of each to the Arduino - one to the RX pin to see what the Arduino is receiving, and one to the TX pin to see what the Arduino is transmitting. You then have to open both COM ports in separate applications (unless you can find an ...


2

Theoretically, nothing should happen to serial data if nothing is listening. For a traditional UART the data is just sent regardless. It doesn't need someone listening for that to happen. Like a light doesn't need someone to see it for it to be on. For USB CDC/ACM the data should be discarded even before it's attempted to be sent. The latter, though, does ...


1

First, you got some logic wrong in the receiver: you have a test for Serial1.available()>=size_gyro and, when this is true, you read size_gyro + 9 bytes. You should change the test in order to only start reading when you actually have size_gyro+9 bytes available. Then, note that command_name is transmitted twice: first as part of the 9-byte preamble (...


1

how to make [two Arduinos communicating with each other] working while connect to computer? There are a variety of ways for 2 Arduinos to directly communicate with each other while one or both are communicating with the Serial Monitor of a laptop computer over USB. Use a UART for the Arduinos to communicate that is independent of the USB connection. (See ...


1

Yes, UART is much slower then the CPU and you run it on extremely slow baud rate. The CPU runs many loops before Serial.available() is again more then 0. From reference of read() function: Returns the first byte of incoming serial data available (or -1 if no data is available).


0

You can do it, but you cannot change the PID and VID without a new certificate. Did you changed the name with the FT-Prog Tool (MProg is outdated)? You can download the last version from here: https://www.ftdichip.com/Support/Utilities.htm#FT_PROG You can set everything on your FTDI chip, even change the PID and VID. But at this point, you will not be able ...


0

I suspect an end of line character is send (probably \n or \r, see comment of Edgar Bonet), or an end of string (0 character). You can easily find it out by printing the integer value of the character: char c = serial.read(); Serial.print((int) c);


2

First of all, you have to decide whether you want to send the data as raw bytes (“binary data”) or as an ASCII text representation. Binary tends to be more efficient: you can send a float with full precision in only four bytes, whereas you would typically need 8 to 9 significant digits to recover the full precision from an ASCII representation. Binary is, ...


3

I tried the code from the link you posted and it worked: struct Gyro_data_structure { char command_name[6]; int gyro_X; int gyro_Y; int gyro_Z; }; struct Gyro_data_structure Gyro_data = {"Hello", 48, 49 , 50}; int size_gyro = sizeof(struct Gyro_data_structure); void setup() { Serial.begin(9600); // opens serial port, sets data rate to ...


1

On Windows You can refer to FTDI's documentation here for details on how to create your own custom device driver. The FTDI website has a lot of resources for this, however they seem to be a little outdated. Microsoft details how drivers work in it's Hardware Dev Center. On Linux On Linux it may be as easy as registering the device with modprobe. For ...


0

I can't comment yet but have you updated your board manger for UNO on unbunto? tools > Board > Board Manger > Search UNO Kind of dumb to have to do that but it happen to me before and this was the solution I did.


0

Not a direct answer to your questions, but after reading your code I would like to give some comments: You are not using “circular buffers”, you are double-buffering. If you used a circular buffer, you would not need two of them. recordingEnded is always false and thus serves no purpose. When writing and change_buffer are both true, you should transmit ...


Top 50 recent answers are included