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
@MLE_online I'd guess that there's a bunch of conditions that trip it into thinking something's wrong. Hall effect throttles don't generally swing all the way from 0v to 5v. For example it might expect like 0.4v or whatever as a released throttle and a slight load across 5v and gnd to decide everything is ok to start.
I've only ever "faked" potentiometer throttles though so this is guessing. (digital pots are handy for this kind of nonsense)
@MLE_online does it work with a pot directly? Sorry if you already answered that somewhere, but if it does a resistor ladder seems like the better answer.
I've never had great luck with trying to use pwm to fake stuff that was being monitored by some IC I didn't understand.