Thanks to a quick google search, I got the basic function to work. On the scope, you can see the control voltage for the motor controller. I used the code from https://github.com/fungineers-youtube/DIY-Onewheel-Arduino-Code and modified it.
The wheel hub motor changes speed according to the gyro input angle. (and makes a very satisfying sound)