New answers tagged

1

From your description I think you are wanting this arrangement: simulate this circuit – Schematic created using CircuitLab There is no logical problem with that arrangement. However you must watch the total current being provided by each GPIO pin. You must not go above 40mA peak, and you should not go above 25mA sustained. It may be better to provide ...


1

You want to replace pin 6 (PH3, OC4A) with pin 7 (PH4, OC4B). There are three things you have to change. First, the output compare register, which is OCR4A for pin OC4A and OCR4B for pin OC4B. Thus: -#define SPINDLE_OCR_REGISTER OCR4A +#define SPINDLE_OCR_REGISTER OCR4B Then, the configuration bit that enables the output: -#define SPINDLE_COMB_BIT ...


0

I believe the servo library uses one (or more depending on board architecture) inbuilt 16 bit timers (timer1 on the UNO) to produce PWM directly on a digital pin using a low level equivalent of a digital write. The direct use of the timer prevents the use of that timer for other purposes like analogWrite(). In comparison a frequently used, more user-...


0

The people over at How to Mechatronics have a great introduction to this board and using it with an Arduino Uno. The enable pins are for turning the motors on and off. See the table for the different settings. But the EN pin is also used for controlling the motor speed. PWM is used to adjust the speed the motors turn at. Rather than simply turning the ...


1

Here is the @Majenko code output The code same as the one posted in the other answer. You can find the simulation link here --> https://wokwi.com/arduino/projects/318609194610590292 I also hooked up a logic analyser and here is how it looks :) You can look how the Duty cyle is becoming larger afer every cycle.


2

Your problem may be in your count down code. Specifically this loop: for (int z = 5; z > -1; z--){ Z starts at 5, and you then try and access element 5 of a 5-element array. That sounds reasonable until you remember arrays are 0-based, so there is no element 5, only elements 0-4. So you're reading data that you shouldn't be reading. Just reading shouldn'...


Top 50 recent answers are included