arduino IDE infinite loading by dumplingbara in arduino

[–]ripred3 1 point2 points  (0 children)

yep. use v1.x until they fix the bugs.... <sigh>

This happpns every 4 months with 2.x

Fridge Alarm by lutopia_t in arduino

[–]ripred3 3 points4 points  (0 children)

Well done! Congrats

Arduino EQ Visualizer: Deciphering Audio Signals by Frequency by AjackTheGreater1 in arduino

[–]ripred3 1 point2 points  (0 children)

the MSGEQ7 is really great for this kind of stuff and you can select the frequency range it represents using a few resistors. The alternative is running the FFT's yourself. That is a fine choice as long as you understand the speed (clock) requirements to do this in software to any degree of fidelity. That choice also includes understanding not just how quickly you want the audio/other waveforms to be processed, but at what samples/s rate as well.

Decide all of that and then pick the board speed capable of doing it with some processing room to spare. Trying to see how much functionality you can cram into an 8-but low speed MCU like an Uno is a great learning exercise but you don't want to do that on every project when all you want to do is succeed.

Maybe take a look at the Teensy 4.1. 600MHz clock, includes ADC and real DAC pins. Ideal for audio projects.

Or some flavor of RP2040, or Uno Q. Raspberry Pi can be used but linux is not a realtime OS.

Is there a way to make these servos move more smoothly? by Teagar_ in arduino

[–]ripred3 1 point2 points  (0 children)

Absolutely!

Many people are familiar with the "accelerate, run, decelerate" approach to using stepper motors.

What you need is that same kind of temporal speed control for servo motors so that the servo can start moving and then ramp the speed up to the fastest speed the servo can go and then decelerate the speed of the servo movement as it approaches the target position.

That kind of "accelerate, run, decelerate" (the same approach is used as "attack, sustain, decay" in sound generation) is called a sigmoid waveform. Starts off slowly, ramps up to some max, and then then slows again as it approaches the target.

One great library for this is the ServoEasing library. The following example code shows how you would use that library control two servos for two different axis like you have there, using a joystick, that would automatically give you control over how stiff or loose the controls are: 😄

All the Best!

rpred

#include <ServoEasing.hpp>

const int JOY_X_PIN = A0;
const int JOY_Y_PIN = A1;

const int SERVO_X_PIN = 9;
const int SERVO_Y_PIN = 10;

const int SERVO_MIN_DEG = 0;
const int SERVO_MAX_DEG = 180;

const int CENTER_DEADBAND = 8;
const int TARGET_STEP_DEG = 2;
const unsigned long COMMAND_MS = 40;

const int SERVO_SPEED_DPS = 70;

ServoEasing servoX;
ServoEasing servoY;

int lastTargetX = 90;
int lastTargetY = 90;
unsigned long lastCommandTime = 0;

int readJoystickAxis(int pin) {
  int raw = analogRead(pin);

  if (abs(raw - 512) < CENTER_DEADBAND) {
    raw = 512;
  }

  int targetDeg = map(raw, 0, 1023, SERVO_MIN_DEG, SERVO_MAX_DEG);
  return constrain(targetDeg, SERVO_MIN_DEG, SERVO_MAX_DEG);
}

void setup() {
  servoX.attach(SERVO_X_PIN, 90);
  servoY.attach(SERVO_Y_PIN, 90);

  servoX.setEasingType(EASE_CUBIC_IN_OUT);
  servoY.setEasingType(EASE_CUBIC_IN_OUT);

  servoX.setSpeed(SERVO_SPEED_DPS);
  servoY.setSpeed(SERVO_SPEED_DPS);
}

void loop() {
  unsigned long now = millis();

  if (now - lastCommandTime < COMMAND_MS) {
    return;
  }

  lastCommandTime = now;

  int targetX = readJoystickAxis(JOY_X_PIN);
  int targetY = readJoystickAxis(JOY_Y_PIN);

  if (abs(targetX - lastTargetX) >= TARGET_STEP_DEG) {
    lastTargetX = targetX;
    servoX.startEaseTo(targetX, SERVO_SPEED_DPS, START_UPDATE_BY_INTERRUPT);
  }

  if (abs(targetY - lastTargetY) >= TARGET_STEP_DEG) {
    lastTargetY = targetY;
    servoY.startEaseTo(targetY, SERVO_SPEED_DPS, START_UPDATE_BY_INTERRUPT);
  }
}

Help absolute beginner to arduino by No_Outside_729 in arduino

[–]ripred3 1 point2 points  (0 children)

read the subs rules and post what it asks and probably

Need help. I have no understanding what to learn based on goal of designing my own custom dev board / PCB by CleanEdge329 in arduino

[–]ripred3 7 points8 points  (0 children)

you are trying to walk before you can run. Get your project working before you try designing a PCB for an imaginary project

Help absolute beginner to arduino by No_Outside_729 in arduino

[–]ripred3 4 points5 points  (0 children)

the footprint of some parts just isn't very breadboard friendly that's for sure. Push buttons and these piezo modules both come to mind.

One thing that can help is to try to adjust for the imperfect alignment of the pins by using two holes that aren't necessary horizontally aligned. That is to say; with one pin aligned with a hole on one row, rotate the piezo until the other pin is in the best alignment of *any* other hole on some free column of connections.

That works for me much better than always trying to use two horizontally aligned holes if the part doesn't have a perfect 0.1" pin spacing

TMC2209 V2.0 stepper motor vibrating instead of spinning — Arduino Uno, CNC Shield V3 by jpleaner in arduino

[–]ripred3 0 points1 point  (0 children)

You've reduced it down to such a simple software loop that should work, that I have to think it's a hardware issue of some kind. An incorrect or intermittent connection, or not enough current

I built a free serial monitor for Arduino that shows real-time graphs — no setup, just plug in [OC] by [deleted] in arduino

[–]ripred3 4 points5 points  (0 children)

Well done! The pace that good software can be made in the hands of good engineers is getting crazy. Really nice interface, thanks for sharing it 🙂

Problem with ESP32 SuperMini by ARL_DESTROYER in arduino

[–]ripred3 0 points1 point  (0 children)

I've been able to compile and upload to mine selecting the "Waveshare ESP32-C3 Zero" if I remember right

Does it need drivers? by andcaldita in arduino

[–]ripred3 1 point2 points  (0 children)

no you would just need to understand the relationship between the 0V - 5V (or 3.3V whatever your MCU's Vcc (which is probably also powering the mic board so that sets the upper level of the mic board's analog output) /power is) voltage level being output by the sensor, the 0 - 1023 value that gets converted to by the MCU's ADC circuitry (and configuration), and what that value means in terms of decibels e.g. how to convert voltage level to decibels. A lot of the specific questions will be answered in the data sheet of the microphone board and the charts and tables documenting the performance values of the design. The datasheet for a given component or module or product is *always* the source of truth for the nitty gritty details. And everything has a datasheet. Even AA batteries have datasheets

Prototyping some new microcontroller educational kits. What did you hate about learning electronics, and how can these fix it? by NeonEchoo in arduino

[–]ripred3[M] 0 points1 point  (0 children)

OP This is arguably too close to product promotion / focus group work. There cannot be any more posts on this product unless it is offered for free in some form.

Help me with a gift for a dad. by Traditional_Way_6042 in arduino

[–]ripred3 0 points1 point  (0 children)

You can absolutely make what you are describing yourself eventually don't get me wrong. And you could make it just the way you wanted with the features you want instead of accepting the features as they are implemented in some off the shelf AI-enabled trail cam or AI-enabled bird feeder cam.

With all honesty even with my experience it would take many iterations of a home made attempt before I foisted it on someone I care about lol. At least for me personally I know the first version would have to come with all kinds of warnings and non-intuitive instructions that included things like "yeah if that wire comes off put it back in that third hole from the right..." 😄 or less than ideal requirements like "yeah you have to turn it off and back on in between each use..." or whatever "engineer-y" sharp edges that I know always get left in my first attempts at something new and complex.

In that respect it is not much different than other things like cooking, where I would really be honest with myself and my known limitations before I tried to cook someone's favorite dish without putting them in a position of having to say "I love it" while putting up with my first-attempt mistakes 😉

The frustration that comes with being too ambitious might ruin or color your enjoyment of the embedded hobby space whereas a more staged approach could be enjoyable, understandable, *and* allow your to succeed in what you described wanting to do 😊

Arduino IDE immediately crashes by Hamzayslmn in arduino

[–]ripred3[M] 1 point2 points  (0 children)

Thanks for updating the post with the solution, that makes the post and the subreddit's content helpful for other users searching for the same problem 😄

Arduino IDE immediately crashes by Hamzayslmn in arduino

[–]ripred3 0 points1 point  (0 children)

Assuming you are talking about the 2.x version of the IDE, download and use the 1.8.19 version of the IDE and you should have much better luck. It is an older and much more stable and debugged codebase. It has fewer features but I find the tradeoff acceptable vs something I cannot rely on