PWM om motor using BOLT QUESTION


#1

HI everyone i am working on my final year project to make a multi platform bot for a medical application
But i am facing a slight problem so far we know that using digitalMultiWrite we can control the two pins to control the motor movement i.e FWD and BWD
Now how do we control the motor’s speed using PWM on BOLT
AnalogWrite would work on only pin how do you control the motor using PWM on BOLT

Please provide me the syntax
Thanks


#2

Hi @satyakeb

As per your requirement, AnalogWrite would work for you. Just connect the motor to any of the digital pins(0-4) and then use this command http://cloud.boltiot.com/remote/Your_API_Key/analogWrite?pin=Pin_No&value=Value(between 0-255)&state=HIGH&deviceName=Your_Device_Name

Note- Just make sure you are not connecting the motor directly to Bolt. Use motor driver IC to connect the motor to bolt.


#3

Hi @sourabh.tiwari

Will the digital pins take the analog input


#4

You are confusing between analog input pins and PWM pins. Analog input pin which is A0 is capable of taking an analog input. The reason for this is that it’s directly connected to the ADC (Analog to Digital Converter) which helps in converting the input analog data to digital data.
PWM(Pulse width modulation) pins on the other hand are sightly different from the digital pins. They are able to output pulses of LOW & HIGH value the duration of which can be controlled. Such PWM signals when given to a connected peripheral at a very fast speed act like an analog signal.


#5

Its ok, i got it.
i have used my Raspberry pi to achieve the function with the help of the ChangeDutyCycle in the RPi.GPIO library . to account for the network lag on the esp8266 bolt chip