Community
    • Login

    printing from file to printer with colored characters

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 46 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • peter clarkeP
      peter clarke
      last edited by

      Hi, I have a file in the app called pid controller. Some characters are in color. Can I get my printer Epson XP-2200 to print as shown in my document?
      I am attaching a copy of my file.
      dadfa698-cfd0-4ff4-b1bd-33b96602b7f2-image.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @peter clarke
        last edited by

        @peter-clarke ,

        Notepad++ will print in the syntax highlighted colors you see in Notepad++, depending on Settings> Preferences > Print. But your screenshot was not of Notepad++, so this isn’t the place to ask questions about Arduino IDE

        In Notepad++, you might have to go to the Style Configurator, C++, and set user extension to ino to get it to recognize Arduino source code.

        1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones
          last edited by PeterJones

          Additional info:

          First, once I was on my computer this morning, I was able to confirm that ino is already in the default list of extensions for C++, so you don’t need to add it to user ext. Sorry for my poor memory.

          Notepad++, by default, doesn’t know the Arduino-specific keywords/constants. But the Style Configurator has 8 “USER KEYWORDS #” styles for C++, and you can add your own keywords into User-defined keywords box for each, and define your own colors.

          Before:
          e1e7f4e3-e45c-4e1c-853d-82658355ecfd-image.png

          After:

          • Change USER KEYWORDS 1 to green, with setup loop
          • Change USER KEYWORDS 2 to orange, with pinMode digitalWrite delay begin
          • Change USER KEYWORDS 3 to bold+orange, with Serial
          • Change USER KEYWORDS 4 to aqua, with HIGH LOW OUTPUT

          d2149d3c-47bd-4c08-a4e6-46bfc6b44aec-image.png

          You would have to go through and figure out any other keywords (I don’t currently have a list of arduino keywords, though you could probably search the forum for “Arduino” and maybe find something).


          Ah, there, I knew it must exist: this post had a link to a zipfile with an old UDL for Arduino. From it, I was able to extract some lists of keywords, paste them into Arduino IDE 1.8.18 to see how it categorizes them, then re-allocate them:

          1. USER KEYWORDS 1:
            loop setup
            
          2. USER KEYWORDS 2:
            ANALOG_PORT BSSID Client END_SYSEX File Firmata MAX_DATA_BYTES REPORT_VERSION RSSI SSID START_SYSEX TOTAL_PORTS WiFiClient WiFiServer Wire abs accept acos analogRead analogReference analogWrite asin atan atan2 attach attachInterrupt attached autoscroll available begin beginPacket beginTransmission bit bitClear bitRead bitSet bitWrite blink blinkVersion callbackFunction ceil clear click close connect connected constrain cos createChar cursor degrees delay delayMicroseconds detach detachInterrupt digitalRead digitalWrite direction disconnect display encryptionType end endPacket endTransmission exists exp find findUntil floor flush gatewayIP getResult getSocket highByte home interrupts isListening isPressed leftToRight listen localIP log lowByte macAddress map max micros millis min mkdir move noAutoscroll noBlink noCursor noDisplay noInterrupts noTone onReceive onRequest open overflow parseFloat parseInt parsePacket peek pinMode position press print printFirmwareVersion printVersion println processInput pulseIn radians random randomSeed read readBytes readBytesUntil readMicroseconds release releaseAll remoteIP remotePort remove requestFrom rightToLeft rmdir round scrollDisplayLeft scrollDisplayRight seek send sendAnalog sendDigital sendDigitalPort sendString sendSysex setBitOrder setClockDivider setCursor setDataMode setFirmwareNameAndVersion setFirmwareVersion setSpeed setTimeout shiftIn shiftOut sin size speed sq sqrt status step stop stringCallbackFunction subnetMask sysexCallbackFunction tan tone transfer version write writeMicroseconds
            
          3. USER KEYWORDS 3:
            Serial Serial1 Serial2 Serial3
            
          4. USER KEYWORDS 4:
            ANALOG_MESSAGE BIN CHANGE DEC DEFAULT DIGITAL_MESSAGE EXTERNAL FALLING FILE_READ FILE_WRITE HALF_PI HEX HIGH INPUT INPUT_PULLUP INTERNAL INTERNAL1V1 INTERNAL2V56 LOW LSBFIRST MSBFIRST OCT OUTPUT PI PROGMEM REPORT_ANALOG REPORT_DIGITAL RISING 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 SYSTEM_RESET TOTAL_ANALOG_PINS TOTAL_DIGITAL_PINS TWO_PI
            

          I don’t guarantee that’s all, or even most, of the Arduino keywords. But it’s a reasonable selection to get you started.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors