Uploading a Sketch with the IDE
While we're working on setting up some tools that will allow non-tech folk to upload preset-based sketches, here's a brief tutorial on how to upload a sketch using the Arduino IDE over Bluetooth. Before you start this tutorial, please make sure you've [set up the IDE correctly](http://nw2s.net/ide-setup-and-installation/) and that you've [gotten Bluetooth pairing working correctly](http://nw2s.net/bluetooth-pairing/). ### Open a Sketch When you run the IDE, navigate to File -> Sketchbook -> nw2s and choose a sketch to open. ### Identify the Board Identify the type of board you will be uploading to. The Due has multiple ways to connect, so when you select the board, you will need to select the type of connection as well. We're using 'Arduino Due (Bluetooth)'. You need to have edited the boards.txt file in the setup steps to see this. This only needs to be done once. Subsequent uploads will default to the last choice. ### Identify the Port Identify the port you will use to upload to. If you've successfully paired with the bluetooth adapter, you'll have a new serial port here. Choose the 'cu' version of the port over the 'tty' version. This step also only needs to be done once and the IDE will remember. ### Erase and Reset This step is only necessary when connecting over Bluetooth. The USB port has a special protocol built into a supporting chip that will trigger the erase sequence automatically as the IDE begins to upload. The Bluetooth connection lacks this ability, so you will need to tell the nw2s::b firmware that you want to upload a new one. 1. Open the serial monitor window and ensure that the line termination option is set to "Newline". 2. In the input field, type the command 'ERASEANDRESET' 3. Hit Enter or press Send 4. The current sketch will stop responding and the Arduino will be waiting for your upload to start ### Upload Press the right-arrow (shown highlighted yellow) to start the compilation process and initiate the upload sequence. First you'll get a confirmation that the files compiled and then you'll see the progress as the binary file is transferred and then verified. Once the upload completes, the Arduino will be reset automatically and the new sketch will start.