I have an Arduino Uno, 9 volt battery, ESC and a brushless outrunner motor. When connecting the motor straight to the battery the motor rotates once which is good but when using my Arduino code to make it turn it just doesn't. I am really new to this and have been lost for hours on what to do. I need to just make the motor spin from the ESC which is being controlled by the Arduino. Please help. Here is an image of my circuit, it's bad but I think it makes sense also "rushless motor" is meant to be "brushless motor":
Also here is my code (there is a closing bracket at the end but i just couldn't fit it all in the screenshot):
also thanks SO SO SO much in advance. I am really stressed at this problem right now.
EDIT: if anyone who is looking on here is abit confused with the code, this is the code that i first use to make my brushless motors spin from my esc's:
automatic control: https://www.arduino.cc/en/Tutorial/LibraryExamples/Sweep
potentiometer control: https://www.arduino.cc/en/Tutorial/Knob
Suprisingly this code works with brushless motors as well as servo motors!