element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Euro sign
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 392 subscribers
  • Views 2012 views
  • Users 0 members are here
Related

Euro sign

ritamüller
ritamüller over 10 years ago

Hallo,

 

How can I enter Euro sign with Serial.print?

 

 

Thx

Rita

  • Sign in to reply
  • Cancel

Top Replies

  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to ritamüller +1
    Your routine that is called print() always puts a new line before it exits therefor your euro symbol will always be on a new line. remove this from the print routine and put the newline statements elsewhere…
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to ritamüller +1
    My assumption about the board is correct, it shares the serial (USB) between the PC console and the RFID reader and therefor you will not be able to eliminate the garbage looking text if you look closly…
Parents
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago

    it seems you have to output Char(128) HEX 80, to the serial device and it should show

     

    i modified the ASCII sample that comes with the IDE to print all from 0 - 255 so it will include the euro symbol

     

    /*
      ASCII table
    
    
    Prints out byte values in all possible formats:
    * as raw binary values
    * as ASCII-encoded decimal, hex, octal, and binary values
    
    
     For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII
    
    
    The circuit:  No external hardware needed.
    
    
    created 2006
    by Nicholas Zambetti
    modified 9 Apr 2012
    by Tom Igoe
    
    
    This example code is in the public domain.
    
    
     <http://www.zambetti.com>
    
    
    */
    void setup() {
      //Initialize serial and wait for port to open:
      Serial.begin(9600);
      while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only
      }
    
    
      // prints title with ending line break
      Serial.println("ASCII Table ~ Character Map");
    }
    
    
    // modified to start with 00 even though some of these may be unprintable:
    int thisByte = 00;
    // you can also write ASCII characters in single quotes.
    // for example. '!' is the same as 33, so you could also use this:
    //int thisByte = '!';
    
    
    void loop() {
      // prints value unaltered, i.e. the raw binary version of the
      // byte. The serial monitor interprets all bytes as
      // ASCII, so 33, the first number,  will show up as '!'
      Serial.write(thisByte);
    
    
      Serial.print(", dec: ");
      // prints value as string as an ASCII-encoded decimal (base 10).
      // Decimal is the  default format for Serial.print() and Serial.println(),
      // so no modifier is needed:
      Serial.print(thisByte);
      // But you can declare the modifier for decimal if you want to.
      //this also works if you uncomment it:
    
    
      // Serial.print(thisByte, DEC);
    
    
    
    
      Serial.print(", hex: ");
      // prints value as string in hexadecimal (base 16):
      Serial.print(thisByte, HEX);
    
    
      Serial.print(", oct: ");
      // prints value as string in octal (base 8);
      Serial.print(thisByte, OCT);
    
    
      Serial.print(", bin: ");
      // prints value as string in binary (base 2)
      // also prints ending line break:
      Serial.println(thisByte, BIN);
    
    
      // if printed last visible character '~' or 126, stop:
      if (thisByte == 255) {    // modified to go all the way to 255
        // This loop loops forever and does nothing
        while (true) {
          continue;
        }
      }
      // go on to the next character
      thisByte++;
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago

    it seems you have to output Char(128) HEX 80, to the serial device and it should show

     

    i modified the ASCII sample that comes with the IDE to print all from 0 - 255 so it will include the euro symbol

     

    /*
      ASCII table
    
    
    Prints out byte values in all possible formats:
    * as raw binary values
    * as ASCII-encoded decimal, hex, octal, and binary values
    
    
     For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII
    
    
    The circuit:  No external hardware needed.
    
    
    created 2006
    by Nicholas Zambetti
    modified 9 Apr 2012
    by Tom Igoe
    
    
    This example code is in the public domain.
    
    
     <http://www.zambetti.com>
    
    
    */
    void setup() {
      //Initialize serial and wait for port to open:
      Serial.begin(9600);
      while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only
      }
    
    
      // prints title with ending line break
      Serial.println("ASCII Table ~ Character Map");
    }
    
    
    // modified to start with 00 even though some of these may be unprintable:
    int thisByte = 00;
    // you can also write ASCII characters in single quotes.
    // for example. '!' is the same as 33, so you could also use this:
    //int thisByte = '!';
    
    
    void loop() {
      // prints value unaltered, i.e. the raw binary version of the
      // byte. The serial monitor interprets all bytes as
      // ASCII, so 33, the first number,  will show up as '!'
      Serial.write(thisByte);
    
    
      Serial.print(", dec: ");
      // prints value as string as an ASCII-encoded decimal (base 10).
      // Decimal is the  default format for Serial.print() and Serial.println(),
      // so no modifier is needed:
      Serial.print(thisByte);
      // But you can declare the modifier for decimal if you want to.
      //this also works if you uncomment it:
    
    
      // Serial.print(thisByte, DEC);
    
    
    
    
      Serial.print(", hex: ");
      // prints value as string in hexadecimal (base 16):
      Serial.print(thisByte, HEX);
    
    
      Serial.print(", oct: ");
      // prints value as string in octal (base 8);
      Serial.print(thisByte, OCT);
    
    
      Serial.print(", bin: ");
      // prints value as string in binary (base 2)
      // also prints ending line break:
      Serial.println(thisByte, BIN);
    
    
      // if printed last visible character '~' or 126, stop:
      if (thisByte == 255) {    // modified to go all the way to 255
        // This loop loops forever and does nothing
        while (true) {
          continue;
        }
      }
      // go on to the next character
      thisByte++;
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube