5

Turns out the short answer is that I'm still not great at using an oscilloscope. Longer version is that the noise was very visible at smaller time scales. A filter capacitor had come disconnected from the breadboard in a way that was hard to see, and that was causing a whole bunch of noise. Replacing it fixed the problem.


3

There is a solution with SD card and SD bootloader. You put a bin file on SD card, insert it into the SD adapter and power up the Arduino. The bootloader loads the bin file to flash memory. I use 'avr_boot' SD bootloader by Zevero. It reads a file named firmware.bin from SD card if present and loads it into flash. To generate a bin file for Arduino AVR ...


2

In your code you are using the measurement_finished variable as a flag, that a new measurement was finished inside the ISRs, so that it can be handled inside the loop() function. This is very useful. As I understood, an open circuit means, that no measurement can happen, since no pulses are created. So you need to check, how much time passed since the last ...


2

the Atmega328P's datasheet, it indicates the conversion factor is 5V/1024 [...] Indeed. And the datasheet is the only authoritative source. All the other sources are second-guessing. If Vin and Vref are 5V, then the ADC reading would need to be 1024 in order to have a true reading of 5V You can't get a true reading of 5 V. As per the datasheet (...


2

As others have said, the difference between 1023 and 1024 is quite small. However, the fact is that your input range for the ADC is 0 to 1023. (That's 1024 steps, but since it starts at 0, it won't go up to 1024) You'll get 0 at the minimum input, and 1023 at the maximum value. If you're using a 5.0V reference voltage and no voltage dividers, that means ...


2

3 different ways to power the Mega2560 besides connecting to a PC: 7.5V to 12V 'wallwart' supplying DC to the barrel jack. 5V wallwart connected to the USB port. 5V wallwart connected to the 5V/Gnd pins on the Power header.


2

int sensor = 900; //variabel sensor void setup() { Serial.begin(9600); while (!Serial); randomSeed(analogRead(A0)); } int number() { int a = random(0, 10); //range pengurang nilai sensor int d = random(500, 1500); //range delay perubahan nilai if (sensor < 670) { sensor = 900; } sensor -= a; delay(d); ...


1

It depends actually on your requirements what is 'best'. If (transmission) speed is an issue, there are mainly some things you can do to improve this: Increase the transmission speed (this depends on the distance of the wires and the noise). Decrease the start/stop bits (this reduces the certainty the values will arrive ok) Pack your data (takes more ...


1

digitalWrite(LMR.LOW); and digitalWrite(LMR.HIGH); Replace the period with a comma.


1

There is no specific piece of hardware that does what you ask. There are various options though: Write a new bootloader that uses the USB Host Shield to load data from a USB MSD device then flash it to the internal flash of the MCU (hard to do if you don't know low-level programming) Use an embedded Linux computer (Raspberry Pi, etc) to run avrdude and ...


1

I tried to understand your program and found quite a few issues, which I am listing below. This is more a general review than a specific answer. I hope it nevertheless helps you fix the code. The major issue is the logic of loop() being quite convoluted and hard to follow. My guess is that the issue you face is a direct consequence of this single problem. I ...


1

Ok i found the issue and the solution. For some reason it seems that while the MCU is running Setup(); hardware or software serial don't work properly. In my case i have code that set the SIM module to SMS mode and to send those messages to the serial port. For some reason it doesn't send them (or probably the module is not ready to accept them). ...


1

Well after more tinkering I found that the one change that fixed everything was simply this (in the if/else statements).....changing MIDI.sendNoteOn(notes[scaleIndex][columnIndex], 127, 1); to MIDI.sendNoteOn(notes[scaleIndex][0], 127, 1); [columnIndex] needs to be a [0], [1] or [2] representing one of three scales in the assigned array. This is fine as I'm ...


Only top voted, non community-wiki answers of a minimum length are eligible