New answers tagged

0

That display is an ILI9341 based one. On the DSO138 it connects the data pins D0-D7 to PORTB of the STM32. You need to connect those 8 pins to 8 pins on the Arduino, along with the RS (Register Select) and CS (Chip Select) pins. The RD pin can be connected to 3.3V and the WR pin to GND, since you only really want to write to the screen (if you do want to ...


0

This answer assumes that each LCD segment is controlled by a separate pin (see comment of Juraj). With a 74HC595 (shift register) you can use SPI to control 8 outputs. You can daisy chain 4 of them to get 32 outputs with just the SPI pins, to get 128 pins. I assume two pins are for GND and VCC. If you need more than 128 GPIO output pins, than use 5 or more ...


2

I have solved the above and will share the answer as it may be of help to others: As the Tx indicator LED on the RS232 shield would not light up when connected to the sensor, I checked the voltage difference between pin 2 (Tx) and pin 5 (GND) of the RS232 connector. This turned out to be only 5V, indicating that the protocol used is TTL-RS232 rather than '...


0

There are two ways of doing this: Multiple INO files The Arduino IDE combines multiple INO files into one single CPP file before compilation. You can split your program across multiple INO files at will. It makes it easier to manage, since you can split your program into logical chunks at will, but you don't have to think much beyond "which file shall I ...


0

This is more like a general programming question than an Arduino question but, anyway... You don't need to write classes to sort your code into files. You just need to think in term of independent pieces of functionality. Each of those pieces would be implemented in a .cpp file, with the interface declared in a .h file. As an example, let's say your ...


1

It sounds like death would be caused by gas poisoning, not CO2 (carbon dioxide) or CO (carbon monoxide) poisoning. If the flame goes out and then gas pressure is restored, un-burnt gas would be vented into the room. Unless gas is burning no CO or CO2 would be released. Further, our bodies detect excess CO2 and it causes us to feel short of breath and seek ...


0

This is a fantastic idea, but you should be a bit more informed before you start the project. I do not think the people suffocate into CO2 because CO2 is not inflammable under normal conditions so it is not used to feed the heaters. It's produced by the heater while it burns. Most probably the heater uses methane (CH4), ethane (C2H6) or propane (C3H8). ...


0

I guess your problem is, that you are using SoftwareSerial. Doing Serial in software means, that you can only listen at one interface at a time, thus only one of the fingerprint sensors work at a time. But you are using the Arduino Mega, which has 4 hardware Serial interfaces. They are named Serial and SerialX (with X being 1,2 or 3). You can give a ...


0

I managed to change SV value. According to the library, when using function code 6, It get sending data(temperature value) from au16regs[0]as below piece of code of library file. Need to setup that value before requesting. (ModbusRtu.h - line number 601) case MB_FC_WRITE_REGISTER: //if cunction code 6 au8Buffer[ NB_HI ] = highByte(au16regs[0]); ...


0

As Adrian McCarthy pointed out, you don't want to be running the speaker outputs into an amp like that. Use a DAC pin and Ground. As to why its stopped working - I've had trouble powering an arduino plus dfplayer from USB. The combination can quite easily draw more current than USB is designed to give. It's a bit fuzzy because not all USB supplies work ...


0

enter code here #define ECHO 5 // Pin received echo pulse #define TRIGGER 6 // Pin sends shot pulse int distance; // the distance in cms unsigned long previousMicros = 0; // will sotre last time TRIGGER was updated long OnTime = 10; //microseconds of on-time long OffTime = 2; //microseconds of off-time unsigned long ...


0

Idiot me. I thought Mega 2560 = ADK. It does not. Once I corrected my board from the Mega 2560 to the ADK, the USB port worked.


0

The old WiFiEsp by Bruno Poltaruri library can't do much with larger data received. The AT firmware sends all the data at once and the serial RX buffer overflows. It works better with 9600 baud which slows down the AT firmware. It is hard to receive more data over network with AT firmware without UART hardware flow control and Arduino AVR boards don't have ...


0

Just a theory for 2: The text that shows up in the Tools > Port list after the COMx eg Tools -> Port -> COM3(Arduino Mega or Mega 2560) is simply what the IDE thinks the board is based on the USB ID (VID/PID) of the board's USB interface chip. For some clones, this is blank because they don't even use the same chip as an authentic Uno. In your case, ...


1

Strings (aka byte arrays of arbitrary length) are perfect for asynchronous and full duplex protocols like UART, essentially because those are no master-slave protocols. Here, both master and slave can transmit a byte stream independent of each other at any time and with any length. But using strings on I2C is quite uncommon. As I2C is a master-slave bus ...


2

I2C works with fixed size byte arrays. Single bytes for commands should be sufficient. For positions you might need int16_t or even bigger numbers. Unsigned positions relative to (above) zero might make things easier, eventually (?) As you have the same architecture on both sides, mapping of byte arrays to bigger numbers via union will work well.


1

Take a look at the Ramps V1.6, it is what I use. It plugs onto the AT Mega board. https://reprap.org/wiki/RAMPS_1.6 The 1.6 has a few improvements. I like the solder in power connectors rather than the plug in ones. More reliable. Because I already had the AT Mega board I decided to try the ramps. There are better boards now, with 32 bit processors. But ...


4

You misunderstand the use of return. The loop function is declared void. That means it doesn't return anything. If you simply remove that return statement completely then your code will do what you want. The return stops the loop. It throws away the value since the loop is defined as returning void, and code execution never reaches the print statement....


0

It's not an answer to your question but it may be useful for someone. If your string has a specific prefix, then you can use simply startsWith and substring. E.g. void loop () if(Serial.available()){ command = Serial.readStringUntil('\n'); Serial.println("Received command: " + command); if(command.startsWith("height")) { Serial.println(...


0

First understand that myStepper.step(x) method is relative steps not absolute. So if you want the motor to do two rotations of 45 steps back to back you should write myStepper.step(45); myStepper.step(45); /// NOT myStepper.step(90) <-- that's 90 MORE steps Second, it looks like your code will increase steps taken by 45 while HOLDING the button down ...


1

Your current code will not show all notes of a scale. Only the notes at 1 and 2 will light up, since you don't sum up the numbers, that you have stored in MajorScale. But I think it is not a great idea to sum them up programatically, since this is a constant and you don't win much by representing the data this way. Instead you should directly initiate the ...


1

You can't delete a line from a file on an SD card. Firstly, there is no such thing as "a line" to delete. There is only data. The concept of "a line" is a purely human interpretation of the data. You can't even delete a line from a file on a PC. That's not how things are done. There are three options: Read the entire file into memory, delete it, and then ...


1

I added pull-up resistors to the board and it started working. Turns out that the boards weren't well designed and the I2C lines were pulled up to 1.8V instead of Vin. By removing the pull-ups and adding pull-ups to Vin, the circuit started functioning. The circuit worked with Mega because it has in-built Pull-up Resistors.


0

The event of a button press is not deterministic in your case. Generally, your delay()-approach combined with reading the current button state is not how sth. like this works. Instead, you have to detect when a button is pressed/released. One way to do that is the following: #define buttonPin 8 bool last_state=false; void loop(){ if(!digitalRead(...


1

I got this same error when my Arduino COM port was busy with other apps. I closed that app and upload Arduino sketch and error disappeared.


Top 50 recent answers are included