Author Topic: Notepad++ in Arduino IDE  (Read 7299 times)

0 Members and 1 Guest are viewing this topic.

Offline medical-nerdTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: gb
  • What's that coming over the hill?
Notepad++ in Arduino IDE
« on: March 20, 2018, 06:13:19 pm »
Hiya

This is a cross-post from another section, I now realise it would be better posted here - hopefully someone can help me.

Hiya

Slightly offtopic - but following  a previous post : using Notepad++ with the arduino IDE

I have followed the following instructions found after a quick search:




Setting up Notepad++ as an alternative editor for Arduino in Windows.


1. Install notepad++(NPP) you have two options full install or portable app, if you already use NPP, the portable version is probably the better option to avoid conflicts.
http://notepad-plus-plus.org/download/v6.3.2.html
http://portableapps.com/apps/development/notepadpp_portable

2. Run NPP, select 'Settings - Style Configurator - C++'

3. in the option 'User EXT:' enter 'ino'

4. Select the option under 'Style:' 'INSTRUCTION WORD'

NOTE word list below is courtesy of user Riva on the Arduino Forums and is reproduced here for ease of use.

5. Cut and paste below word list into 'User-defined Keyword' text box

abs accept acos analogRead analogReference analogWrite asin atan atan2 attach attached attachInterrupt autoscroll available begin beginPacket beginTransmission bit bitClear bitRead bitSet bitWrite blink blinkVersion BSSID callbackFunction ceil char class clear click Client close connect connected const constrain cos createChar cursor degrees delay delayMicroseconds detach detachInterrupt digitalRead digitalWrite direction disconnect display double EEPROM encryptionType end endPacket endTransmission Ethernet EthernetClient EthernetServer exists exp File find findUntil Firmata float floor flush gatewayIP getResult getSocket highByte home int int16_t int32_t int64_t interrupts IPAddress isListening isPressed Keyboard leftToRight length LiquidCrystal listen localIP log long loop lowByte macAddress map max micros millis min mkdir Mouse move NewSoftSerial noAutoscroll noBlink noCursor noDisplay noInterrupts noTone null onReceive onRequest open overflow parseFloat parseInt parsePacket peek pinMode position press print printFirmwareVersion println printVersion private processInput prog_char prog_int16_t prog_int32_t prog_int64_t prog_int8_t prog_uchar prog_uint16_t prog_uint32_t prog_uint64_t prog_uint8_t prog_void PROGMEM protected public pulseIn radians random randomSeed read readBytes readBytesUntil readMicroseconds receive register release releaseAll remoteIP remotePort remove requestFrom rightToLeft rmdir round RSSI scrollDisplayLeft scrollDisplayRight SD seek send sendAnalog sendDigital sendDigitalPort sendDigitalPortPair sendString sendSysex Serial Serial1 Serial2 Serial3 Server Servo setBitOrder setClockDivider setCursor setDataMode setFirmwareNameAndVersion setFirmwareVersion setSpeed setTimeout setup shiftIn shiftOut short signed sin size speed SPI sq sqrt SSID static status step Stepper stop String stringCallbackFunction subnetMask substring sysexCallbackFunction systemResetCallbackFunction tan toInt tone transfer uint16_t uint32_t uint64_t uint8_t unsigned version void WiFi WiFiClient WiFiServer Wire word write writeMicroseconds
   
6. Select the option under 'Style' 'Type word'

7. Cut and paste below word list into 'User-defined Keyword' text box

ANALOG_MESSAGE ANALOG_PORT BIN CHANGE DEC DEFAULT DIGITAL_MESSAGE END_SYSEX EXTERNAL FALLING FILE_READ FILE_WRITE HALF_PI HEX HIGH INPUT INPUT_PULLUP INTERNAL INTERNAL1V1 INTERNAL2V56 LOW LSBFIRST MAX_DATA_BYTES MSBFIRST OCT OUTPUT PI PWM REPORT_ANALOG REPORT_DIGITAL REPORT_VERSION RISING SERIAL_5E1 SERIAL_5E2 SERIAL_5N1 SERIAL_5N2 SERIAL_5O1 SERIAL_5O2 SERIAL_6E1 SERIAL_6E2 SERIAL_6N1 SERIAL_6N2 SERIAL_6O1 SERIAL_6O2 SERIAL_7E1 SERIAL_7E2 SERIAL_7N1 SERIAL_7N2 SERIAL_7O1 SERIAL_7O2 SERIAL_8E1 SERIAL_8E2 SERIAL_8N1 SERIAL_8N2 SERIAL_8O1 SERIAL_8O2 SET_PIN_MODE SPI_CLOCK_DIV128 SPI_CLOCK_DIV16 SPI_CLOCK_DIV2 SPI_CLOCK_DIV32 SPI_CLOCK_DIV4 SPI_CLOCK_DIV64 SPI_CLOCK_DIV8 SPI_MODE0 SPI_MODE1 SPI_MODE2 SPI_MODE3 START_SYSEX SYSTEM_RESET TOTAL_ANALOG_PINS TOTAL_DIGITAL_PINS TOTAL_PORTS TWO_PI

8. Click 'Save & Close'

8a. if you find words missing then they are easy to add, perhaps we can find a place for adding words, to keep list up to date

9. Download http://sourceforge.net/projects/sourcecookifier/ and install the addon, if you installed NPP just follow the normal install routine

10. if you have installed the portable app version unpack sourcecookifier into '\App\Notepad++\plugins' which is below the directory that you have the NPP executable

11. Restart NPP

12. Select 'Plugins - SourceCookifier - Language Settings' under 'Language' select 'C++' under 'Extensions' add '.ino'

13. click 'OK'

14. Select 'Plugins - SourceCookifier' and ensure 'Toggle SourceCookiefier' is ticked

15. Select 'Run' and go to your arduino directory, select the arduino file, mine looks like this C:\arduino-1.0.4\arduino.exe

16 add the following to the end of the line $(FULL_CURRENT_PATH), so it should look something like this
C:\arduino-1.0.4\arduino.exe $(FULL_CURRENT_PATH)

17. Save this as 'ArduinoIDE' or whatever you wish to call it, you may also add a hotkey combination if you wish

18. You can now load a sketch and you should see the lexer, tokenizer, colourizer or magic crayoning is working, in addition, you should have a right hand panel with all your functions and variables etc. in a treeview.  If you double click on one of these you will be taken to it.

19. If you like to use multiple files for you projects, set SourceCookifier session mode to N++ session, this will list all functions variables etc. in all open files and let you jump to these with a double click.


20. when you are ready to compile and upload, SAVE your file or files and click 'Run' and select the option you created in step 17.

21. You may, if you wish, in the Arduino IDE preferences select use external editor, this will stop you from editing in the Arduino IDE, to avoid confusion.



Now after saving, when trying to run I get an error code 2 , file not found.

Can anyone help ???


Cheers


I have a file open in Notepad++, when I follow the instructions to Run - ArduinoIDE (step 20 above)


I get a ShellExecute error.

The system cannot find the file specified.
An attempt was made to execute the below command.
---------------------------------------------------------------
Command: C:\Program
Arguments: Files (x86)\Arduino\arduino.exe
C:\Users\steve\Desktop\dds\Rotary\examples\interrupt\Interrupt1.ino
Error Code:2
--------------------------------------------------------------

The Interupt1.ino is the file I am trying to import into the Arduino IDE and compile.
It does exist in the folder/file specified in the error.

Cheers
'better to burn out than fade away'
 
The following users thanked this post: jamiechi

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: Notepad++ in Arduino IDE
« Reply #1 on: March 20, 2018, 06:48:29 pm »
Spaces in the resulting (hidden) command line that's being executed are being parsed incorrectly. And, of course, windows installs everything by default in a directory with spaces in it.

I've no experience with NPP itself, but I suspect that going back and adding surrounding quotes in step 16 will fix it.
e.g.: "C:\Program Files (x86)\Arduino\arduino.exe"

If that doesn't work, you can use the short file name alternative:
Open a cmd window. To see short names: DIR /X  C:\ 
In step 16 replace the Program Files (x86) part with that short name....probably something like PROGRA~2

If that doesn't work, then I'd suggest reinstalling the arduino environment in a different directory, one without spaces. Then do step 16 again. (That is what the guy who gave you the instructions did, from his example.)
« Last Edit: March 20, 2018, 06:58:50 pm by Nusa »
 



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf