New answers tagged

1

Your problem is that you aren't sending the values from python in bytes. A more reliable way is to send the data in bytes like dat.write(b'1') and then receive it on the Arduino using Serial.readString(). I also had many issues with this and this is the best solution. "https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/#:~:text=The%...


3

Smoke is a definite sign something failed. The LED (power indicator)is independent of the microprocessor, it just indicates power is applied in the appropriate direction. Go to the basics, and load the simple blink sketch and see if it works, if so you are lucky. You then might want to write some code to check all the outputs and inputs. It is possible you ...


0

Consider constraining the user and simplifying your code. Simplify your code by putting rules on how the IP address is entered. When entering the IPv4 address in dot-decimal notation require that all 3 digits are always used for each of the four quad-dotted notation values. For example, the IPv4 address 192.168.10.20 would be entered as "192168010020&...


2

Writing Junk From Memory Serial.write(analogRead(A0) + "\r\n"); This is advancing a pointer to "\r\n" by whatever number is being returned by analogRead. In other words, you are not sending the measurement but junk from memory after (or sometimes at) "\r\n"'s memory location. Serial.println(analogRead(A0)); appears to be what ...


1

I obtained the values ​​I wanted and performed the separation. I am sending a list of joystick positions via the serial connection to the arduino in the following format 515;520 Which would be parsed as: x=515 y=520 MyCoordinator: #include <SoftwareSerial.h> #define xBeeRxPin 10 #define xBeeTxPin 9 int deger3; int deger4; SoftwareSerial xBeeSerial(...


5

High likely you are exceeding your character array, see: char a[5]; Which can hold 5 characters. However, you write: if(strcmp(a,"RGB_1") == 0) Which assumes you receive "RGB_1" which is 6 characters, because a string ends with a 0. What also might happen is that you indeed receive only 5 characters without the ending newline, which ...


1

Yes, it is not easy, lot of details to MQ-7 is here: http://www.arduinohobby.euweb.cz/ in the section "Analysator CO"


4

There are two things wrong with the circuit in that demo. There is no decoupling capacitor on the power pins. This is required to keep the power stable during opertaion. More critically: this is being powered from 3.3V, but is being run at 16MHz. That is outside specifications. You should use an 8MHz crystal to operate at 3.3V.


1

I tested a lot of baud rates on Arduino Unos, including cheap Chinese models, and decided to use a default 115200 for my DaqPort system (https://www.daqarta.com/dw_rraa.htm). I had found problems, like the system hanging after a second or so at 150000 baud, and didn't want to have my users run into issues that would be hard to troubleshoot. So I'm wondering ...


3

At 115200 baud you can send 11520 characters per second. At 20 bytes per packet you can send 576 packets per second. That's 1,736µs per packet. That's assuming zero wait between bytes. That's not going to happen. Your measurement of 70µs will just be the time taken to place data into the transmit buffer, and has nothing to do with how long the transmission ...


1

There is a fundamental problem with your communication strategy, and that is you have nothing to tell the receiver "This is the end of a message". You are sending a constant stream of 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510..... and the receiver really doesn't ...


0

You need to place the decleration outside of your setup() function. In other words, you need to move the following 3 lines and place then above your setup() function: #include <Servo.h> Servo Servo_Pointer; int servo_pos = 0; Your code should look like this: #include <Servo.h> const int photo_left = A0; // select the input pins for the ...


0

I would steer you away from using something that has a chip with neither a USART nor USB hardware for the purposes of making something like that. The ATTiny85 that's on the Digispark has USI (Universal Serial Interface), which is really more of a USART construction kit. The USB support it has is bitbanged and somewhat unreliable. If you do go in this ...


2

Yes, that shield will handle the level shifting for you. If you look closely at the images of the shield, you see the MAX232 chip, which is a commonly used chip for getting UART (which is the Serial interface of the Arduino) to speak over RS232. And yes, RS232 uses different voltage levels. The UART on a microcontroller usually uses the voltages 0V and 5V (...


0

The third option, sprintf, is unsafe and may give buffer overruns if buffer is not sized correctly. You can use snprintf instead. However I would recommend my SafeString library and tutorial for general string processing and output.


3

You should make Servo Servo_Pointer; global, i.e. place it outside the setupfunction, e.g. after the line int average = 0;. In your code, it is a local variable within the setup function. When this function ends, the local variables within this function (such as Servo_Pointer ) do not exist anymore. By making the variable global, you can use it anywhere. ...


1

you must use this code >>> import serial >>> ser.close() # close port


3

minicom and screen are useful if you want bidirectional communication between the Arduino and the host computer. If you only want to read what the Arduino sends, that can be done with cat: stty -F /dev/ttyACM0 raw 115200 cat /dev/ttyACM0


2

I use minicom. $ sudo apt-get install minicom ... blah blah blah ... $ minicom -D /dev/ttyACM0 -b 115200 Minicom can take a bit of getting used to. Use CTRL-A to initiate a command sequence. CTRL-A X is exit. CTRL-A O is configuration ("Options") where you can configure flow control and such. Many people also use screen to do the same job, but I ...


1

There is no "built-in USB" on the Nano. There is only the FT232RL chip which talks USB. That chip is connected directly to the TX/RX pins inside the board. You are already communicating over the TX/RX pins through the FT232RL to the USB. Yes, you could use your own FT232RL (or FT232-like) board to communicate between USB and the TX/RX pins, but ...


1

In the arduino ide, go to file > examples > arduino as isp. Might be a good starting point. Seems like a lot of work though. If I were in that situation then I'd either use an ethernet cable and SSH, or, use a mobile phone as a WiFi hot-spot.


3

First you will need a TTL to RS-232 adaptor. These are most commonly known as the "MAX232" and is available as a little module. This will convert the 0-5V TTL signal the Arudino produces into the ±10V signal that RS-232 uses. There's plenty of tutorials online about how to use them. Then you need to generate the signal. Yes, for the Arduino UNO the ...


2

You may also put Arduino in a reset state then Rx & Tx lines of serial converter will be free.


Top 50 recent answers are included