// This is an update to an earlier thread I created that had become muddled with my running commentary trying to get Arduino language support in Notepad++
After several attempts to configure a Arduino bias user defined language for Notepad++ (NPP) I managed to get something close to what I wanted (all the core and standard library keywords) but some keywords would not highlight as expected and I put this down to limitations of the otherwise excellent NPP user language lexicon. I was going to give up at that but then had the idea of adding Arduino keywords to NPP's built in C++ lexicon. This does seem to work better but at the expense of confusing the C++ language for pure C++ programming. My final solution was to download a portable version of NPP and perform my Arduino C++ additions on this copy so I have a normal C++ version to fall back on if needed.
If your interested then download and extract a portable version of NPP via here Notepad++ Portable (development text editor) | PortableApps.com
Load it up, configure it to you liking and install any plugins you use.
Open Style Configurator (Settings->Style Configurator...)
Under 'Language' select 'C++' and then select 'INSTRUCTION WORD' under 'Style'. This should show two text boxes on the right called 'Default keywords' & 'User-defined keywords'.
Copy & paste the line below that begins 'abs accept' into the 'User-defined keywords' text box.
Under 'Style' select 'TYPE WORD' and copy & paste the below line beginning 'ANALOG_MESSAGE' into the 'User-defined keywords' text box.
Under 'User ext.' type 'ino' (without the ' markers) into the box provided
Finally, click 'Save & Close' button and you should now have a portable Arduino bias C++ editor in NPP
INSTRUCTIONS
abs accept acos Adafruit_GFX Adafruit_ST7735 analogRead analogReference analogWrite answerCall asin atan atan2 attach attached attachGPRS attachInterrupt autoscroll available background begin beginPacket beginSMS beginTransmission begnWrite bit bitClear bitRead bitSet bitWrite blink blinkVersion BSSID byte callbackFunction ceil changePIN char checkPIN checkPUK checkReg circle class clear click Client close config connect connected const constrain cos createChar cursor degrees delay delayMicroseconds detach detachInterrupt digitalRead digitalWrite direction disconnect display double draw drawBitmap drawChar drawCircle drawCircleHelper drawFastHLine drawFastVLine drawLine drawPixel drawRect drawRoundRect drawTriangle EEPROM encryptionType end endPacket endSMS endTransmission endWrite Esplora Ethernet EthernetClient EthernetServer exists exp File fill fillCircle fillCircleHelper fillRect fillRoundRect fillScreen fillTriangle find findUntil Firmata float floor flush gatewayIP gatVoiceCallStatus getBand getCurrentCarrier getIMEI getPINUsed getResult getRotation getSignalStrength getSocket getvoiceCallStatus GPRS GSM GSM_SMS GSMBand GSMClient GSMModem GSMPIN GSMScanner GSMServer GSMVoiceCall hangCall height highByte home image int int16_t int32_t int64_t interrupts invertDisplay IPAddress isListening isPIN isPressed isValid Keyboard leftToRight LiquidCrystal listen loadImage localIP log long loop lowByte macAddress map max micros millis min mkdir Mouse move newColor NewSoftSerial noAutoscroll noBlink noCursor noDisplay noFill noInterrupts noStroke noTone null onReceive onRequest open overflow parseFloat parseInt parsePacket peek PImage pinMode point 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 quad radians random randomSeed read readAccelerometer readBlue readButton readBytes readBytesUntil readGreen readJoystickButton readJoystickSwitch readJoystickX readJoystickY readLightSensor readMicrophone readMicroseconds readNetworks readRed readSlider readTemperature ready receive rect register release releaseAll remoteIP remoteNumber remotePort remove requestFrom retrieveCallingNumber rightToLeft rmdir round RSSI scrollDisplayLeft scrollDisplayRight SD seek send sendAnalog sendDigital sendDigitalPort sendDigitalPortPair sendString sendSysex Serial Serial1 Serial2 Serial3 Server Servo setBand setBitOrder setClockDivider setCursor setDataMode setDNS setFirmwareNameAndVersion setFirmwareVersion setPINUsed setRotation setSpeed setTextColor setTextSize setTextWrap setTimeout setup shiftIn shiftOut short shutdown signed sin size speed SPI sq sqrt SSID static status step Stepper stop stringCallbackFunction stroke subnetMask switchPIN sysexCallbackFunction systemResetCallbackFunction tan text textSize textWrap TFT tone transfer triangle uint16_t uint32_t uint64_t uint8_t unsigned version voiceCall void width WiFi WiFiClient WiFiServer WiFiUDP Wire write writeBlue writeGreen writeMicroseconds writeRed writeRGB
I don't try and compile arduino projects from within NPP as I think you need batch scripts to do that.
What I do though is within the Arduino IDE preferences I have ticked the 'Use External Editor'.
When I want to edit & compile code I load it into the Arduino IDE and open it in NPP, write/modify my code in NPP and save it. Then clicking verify/upload in the Arduino IDE automatically reloads the modified file and compiles it.
EDIT:
What is the -run on the end of your run command for?
Perhaps , it will be sufficient also for me to do like your compiling process !
The "-run" was given in the script example for launching tcc.exe (see the guide of using NppExec)
ThievingSix:
Just to note, your missing "String" and "word" from your instructions list.
Thanks for pointing out the error ThievingSix, I have updated the instructions to include the missing words.
Glad you find it helpful, if only Arduino IDE's were as good as NPP
Cool :), I'm glad I wasn't just clueless. haha, I looked over that page many times.
Anyhow, thank you for this post! I tried the eclipse plugin but it was more than I needed. I also just mariaMole, but it didn't have function/bracket & comment minimizing. This was the perfect balance of lightweight addition to the arduino IDE. I fixed up a big .ino and really enjoyed the notepad presentation. Far less scrolling up and down
To be honest, I'm messing about with the best solution, for me, with Arduino.
I am investigating your solution for notepad++, which is nice, I use notepad++ as the external editor, then compile and upload with Arduino IDE, and it works well, gives the benefits of a mature editor with the Arduion IDE.
However, the Arduino IDE upgrades and you are busy, and so now the question, how do I change your code to deal with new methods, such as.
int intMinute = inputString.substring(2,4).toInt();
ijm51000:
However, the Arduino IDE upgrades and you are busy, and so now the question, how do I change your code to deal with new methods, such as.
int intMinute = inputString.substring(2,4).toInt();
Hi Ian,
Glad you and others find the NPP definitions useful. It's true I have not added any new keywords for 1.0.4 as I'm still 1.0.3.
What part(s) of the example you supplied above are arduino keywords? All you need to do is add them to the INSTRUCTIONS list and add/replace this list as instructed above to NPP.
I will hopefully get round to upgrading to 1.0.4 and altering this list within a few weeks.
EDIT: Ignore below as I noticed it 1.5.2 that has command line build and not 1.0.4
Also I noticed that 1.0.4 has command line build so maybe you can trigger a build from NPP instead of flipping to the IDE and pressing build.
Glad you got it working as you wanted. I noticed CodeBlocks have an Arduino Uploader that can compile & upload arduino sketches. You could maybe get this to work with NPP or switch to using Codeblocks if it meets your needs.
I have tried CodeBlocks, Eclipse and Atmel studio and a few others, they are good and all have benefits, but by the time you setup a new project it feels like you could have written a new version of windows:) I am sure if you are working full time on Atmel products these IDE's would have a big advantage and I will probably revisit CodeBlocks as it was the best fit for me.
However at the moment for me using NPP in conjunction with Arduino IDE set to external editor has a lot of benefits in a simple to use setup.
Keyword highlighting
code folding
own functions, defines, vars listed in a right hand panel which you can jump to with a double click
Run and load Arduino IDE with current file from NPP, which means with a couple of clicks you can setup board type, com port, compile & run
And quite a few more not listed.
Also Arduino 1.5 as you pointed out in a previous post, is on its way with extra features and using the method above; upgrading should not be too big a problem(he says stupidly just change the directory.
The Arduino IDE is called by a lot of people for lacking this and that feature but does IMHO a very good job of what it is designed to do, hide a lot of tedious detail that would stop a lot of none technical people getting involved in the project, while at the same time letting the user get more and more involved in the more technical details if they so wish.
Yes I also tried codeblocks but for most projects I do on Arduino the NPP/IDE combination suits best. I just hope they don't go the route of processing IDE and remove the 'use external editor' option.
Got a bit worried after your last reply and downloaded 1.5.2 just to check you can still use an external editor with that version and the answer is yes, the external editor option is the same as 1.04.
Yesterday I also tried komodo edit as it is cross platform and, quickly managed to get a rough User Defined Language plugin built(cut and paste from NPP), then looked at syntax highlighting at which point it was reconfirmed for me anyway that NPP & Arduino IDE are a good middle ground.