[SOLVED] Inverted PWM signal - driving a DC motor controller

Need help on using blynk (Arduino) to drive a DC motor controller (roboteq ax3500) but it’s not sending (joystick) the signal properly and i’ve read from another arduino forums that the PWM signal needs to be inverted.

how do i implement the pwm signal inversion using blynk.

void invertAnalogWrite(int pin, int value)
analogWrite(pin, value);
TCCR1A = TCCR1A & ~B00110000; //switch off output B
TCCR1A |= B00110000; //switch on the B output with inverted output

void loop()

any help will do. - thank you.

First: you can change values that joystick sends in widget settings

But I think it’s not what you need. If you have a code that works without Blynk - post it here. We’ll figure out how to deal with it.

Hi Pavel,

I’ve read about blynk using servo command using https://github.com/blynkkk/blynk-library/blob/master/examples/GettingStarted/Servo/Servo.ino this might work.

How do i tell blynk control to use pin5 and pin6 for servo using the joystick.

We have joystick example for that.

I’m using two separate PWM channels ch1/ch2 mixed mode operation on pin5 and pin6 on arduino
how do i use the joystick?

I would like to see your code first. Secondly, you have 2 options:

  1. Open joystick settings(tap once on joystick)
  • switch to SPLIT mode
  • Set pin [0] - D5, select min/max values to send
  • Set Pin[1] - D6, select min/max values to send
  • Exit settings
  • Press play

Or :

  1. Open joystick settings
  • switch to MERGE mode
  • choose any Virtual Pin
  • use example sketch mentioned by Dmitriy

i need your help for my project,…speed control of dc motor…i have arduino uno and w5100 ethernet shield…help me sir

You gonna need a motor driver because a DC motor will take way too much current for your Arduino, it’l be blown to bits. I personally use these:

They suit me very well and can handle high loads. I use them in combination with a stepper motor from a printer (for my vinyl record cleaner, don’t ask … ) but you can use them also for independently controlling up to two DC motors.

your comment was very usefull to me…thank you very much sir…