arduino.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. module.exports = function(hljs) {
  2. var CPP = hljs.getLanguage('cpp').exports;
  3. return {
  4. keywords: {
  5. keyword:
  6. 'boolean byte word string String array ' + CPP.keywords.keyword,
  7. built_in:
  8. 'setup loop while catch for if do goto try switch case else ' +
  9. 'default break continue return ' +
  10. 'KeyboardController MouseController SoftwareSerial ' +
  11. 'EthernetServer EthernetClient LiquidCrystal ' +
  12. 'RobotControl GSMVoiceCall EthernetUDP EsploraTFT ' +
  13. 'HttpClient RobotMotor WiFiClient GSMScanner ' +
  14. 'FileSystem Scheduler GSMServer YunClient YunServer ' +
  15. 'IPAddress GSMClient GSMModem Keyboard Ethernet ' +
  16. 'Console GSMBand Esplora Stepper Process ' +
  17. 'WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage ' +
  18. 'Client Server GSMPIN FileIO Bridge Serial ' +
  19. 'EEPROM Stream Mouse Audio Servo File Task ' +
  20. 'GPRS WiFi Wire TFT GSM SPI SD ' +
  21. 'runShellCommandAsynchronously analogWriteResolution ' +
  22. 'retrieveCallingNumber printFirmwareVersion ' +
  23. 'analogReadResolution sendDigitalPortPair ' +
  24. 'noListenOnLocalhost readJoystickButton setFirmwareVersion ' +
  25. 'readJoystickSwitch scrollDisplayRight getVoiceCallStatus ' +
  26. 'scrollDisplayLeft writeMicroseconds delayMicroseconds ' +
  27. 'beginTransmission getSignalStrength runAsynchronously ' +
  28. 'getAsynchronously listenOnLocalhost getCurrentCarrier ' +
  29. 'readAccelerometer messageAvailable sendDigitalPorts ' +
  30. 'lineFollowConfig countryNameWrite runShellCommand ' +
  31. 'readStringUntil rewindDirectory readTemperature ' +
  32. 'setClockDivider readLightSensor endTransmission ' +
  33. 'analogReference detachInterrupt countryNameRead ' +
  34. 'attachInterrupt encryptionType readBytesUntil ' +
  35. 'robotNameWrite readMicrophone robotNameRead cityNameWrite ' +
  36. 'userNameWrite readJoystickY readJoystickX mouseReleased ' +
  37. 'openNextFile scanNetworks noInterrupts digitalWrite ' +
  38. 'beginSpeaker mousePressed isActionDone mouseDragged ' +
  39. 'displayLogos noAutoscroll addParameter remoteNumber ' +
  40. 'getModifiers keyboardRead userNameRead waitContinue ' +
  41. 'processInput parseCommand printVersion readNetworks ' +
  42. 'writeMessage blinkVersion cityNameRead readMessage ' +
  43. 'setDataMode parsePacket isListening setBitOrder ' +
  44. 'beginPacket isDirectory motorsWrite drawCompass ' +
  45. 'digitalRead clearScreen serialEvent rightToLeft ' +
  46. 'setTextSize leftToRight requestFrom keyReleased ' +
  47. 'compassRead analogWrite interrupts WiFiServer ' +
  48. 'disconnect playMelody parseFloat autoscroll ' +
  49. 'getPINUsed setPINUsed setTimeout sendAnalog ' +
  50. 'readSlider analogRead beginWrite createChar ' +
  51. 'motorsStop keyPressed tempoWrite readButton ' +
  52. 'subnetMask debugPrint macAddress writeGreen ' +
  53. 'randomSeed attachGPRS readString sendString ' +
  54. 'remotePort releaseAll mouseMoved background ' +
  55. 'getXChange getYChange answerCall getResult ' +
  56. 'voiceCall endPacket constrain getSocket writeJSON ' +
  57. 'getButton available connected findUntil readBytes ' +
  58. 'exitValue readGreen writeBlue startLoop IPAddress ' +
  59. 'isPressed sendSysex pauseMode gatewayIP setCursor ' +
  60. 'getOemKey tuneWrite noDisplay loadImage switchPIN ' +
  61. 'onRequest onReceive changePIN playFile noBuffer ' +
  62. 'parseInt overflow checkPIN knobRead beginTFT ' +
  63. 'bitClear updateIR bitWrite position writeRGB ' +
  64. 'highByte writeRed setSpeed readBlue noStroke ' +
  65. 'remoteIP transfer shutdown hangCall beginSMS ' +
  66. 'endWrite attached maintain noCursor checkReg ' +
  67. 'checkPUK shiftOut isValid shiftIn pulseIn ' +
  68. 'connect println localIP pinMode getIMEI ' +
  69. 'display noBlink process getBand running beginSD ' +
  70. 'drawBMP lowByte setBand release bitRead prepare ' +
  71. 'pointTo readRed setMode noFill remove listen ' +
  72. 'stroke detach attach noTone exists buffer ' +
  73. 'height bitSet circle config cursor random ' +
  74. 'IRread setDNS endSMS getKey micros ' +
  75. 'millis begin print write ready flush width ' +
  76. 'isPIN blink clear press mkdir rmdir close ' +
  77. 'point yield image BSSID click delay ' +
  78. 'read text move peek beep rect line open ' +
  79. 'seek fill size turn stop home find ' +
  80. 'step tone sqrt RSSI SSID ' +
  81. 'end bit tan cos sin pow map abs max ' +
  82. 'min get run put',
  83. literal:
  84. 'DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE ' +
  85. 'REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP ' +
  86. 'SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN ' +
  87. 'INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL ' +
  88. 'DEFAULT OUTPUT INPUT HIGH LOW'
  89. },
  90. contains: [
  91. CPP.preprocessor,
  92. hljs.C_LINE_COMMENT_MODE,
  93. hljs.C_BLOCK_COMMENT_MODE,
  94. hljs.APOS_STRING_MODE,
  95. hljs.QUOTE_STRING_MODE,
  96. hljs.C_NUMBER_MODE
  97. ]
  98. };
  99. };