Does anyone on here know if the capacitor-resistor combo attached to a pwm output pin of an Arduino gives a decent analog output?
People replied a lot while I was sleeping. I''m not going to give the same response to everyone who was asking what its for, so I'll just say it here. I want to use an arduino to spoof the 0-5V analog throttle signal on this ebike i'm building.
As best I can tell, ebike throttle units put out an analog voltage without any kind of data signal, but somehow the e-bike knows the difference between a real throttle, and one made out of an arduino, or even made out of a bench power supply. It will only run when connected to an actual ebike throttle

I'm getting somewhere now. It's not giving full throttle but it is giving some throttle.

I had to hook up the throttle unit in parallel with the Arduino for the bike to accept inputs from the Arduino.

This might work out ok because i wanted to have a throttle lever and pedal assist anyway.

More testing to do still!

I briefly had it working without the throttle connected. I had put a 1.2K resistor between the positive and ground wires and that did it. The bike was under control of the Arduino. Then it just stopped working and hasn't worked since.

The Arduino still works, and the bike still works if I hook a regular throttle to it. Mysterious

Okay, it's working again. I don't know what's different, but it's working
Omg, not working again. This is kind of frustrating!
@MLE_online Does the motor controller need to see a voltage in the range that represents 0% throttle input when it powers up to unlock and start being receptive to throttle inputs?

@foundthefault @MLE_online

excellent point.
and is 0% throttle represented by +5V or 0V?