Hot answers tagged

2

With some inspiration from timemage's comment, I decided in the long run to implement my own power function that takes two int arguments and returns an int. Rather than use the pow function in the <math.h> library which returns a double when I only need an int. int power(int x, int y) { return y == 0 ? 1 : x * power(x, y - 1); } Now the program ...


1

This does not resolve the issue, but for now it is "fixed". On the I2C interface stepper driver is interfering with the microcontroller, and it must be some electrical interference, if I disconnect the stepper motor from the stepper driver then it works. (Just saying again... NOTHING is plugged into the Arduino from the stepper driver or the ...


1

Many internet sources like this one claim the HC-SR501 requires less than 50uA (or 0.00005 Amps). Likely this is only in a quiet or quiescent state and current demand may increase initially when power is applied and when motion is detected. Regardless, this is an insignificant fraction of a 2 Amp power supply. Likely the Atmel 328p will require several ...


1

In a word, no. Laptop or desktop computer usually have USB ports, which put out like 10 watts of power for a "high current" USB port. That is not enough to do much heating or cooling. You want a high power supply. The pelteir plates I've seen run on 12V DC. Get a 5A 12V supply, or even higher. You might be able to draw larger amounts of current ...


1

When it comes for amount of power from laptop, then this is not realy reasonable to expect even USB3, maybe some older laptops PCMCIA, or hardware docks. When it comes to Desk, They would have to be adjusted to get the ATX from PSU (it would have to be upgraded for purpose) We are still talking about a small Can or Yacult botle... Even then insulate, ...


1

As explained by @chrisl in a comment, the issue is that pow() does not return an exact result, only an approximation. It works fine with compile-time constants because in this case it is evaluated at compile time, by the compiler, on you PC. Simple solution: replace the cast to int with round(): int multiplier = round(pow(10, argc - 1)); This works, but is ...


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