2018
February Tuesday 20

Bookmark and Share

Related Articles...

MILWAUKEE WI Arduino Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Arduino Make Space Acquired!

Email :

COASMailBox @ gmail.com

World Class Tier 1 Embedded Computing Services

CGI Computer Wares

CONTACT:

COASMailBox @ gmail.com

Data Collectors, Loggers, IoT, Data Distribution Systems - Custom Builder Programmer With Continued Management & Support Subscriptions

38+ Years Independent Computer Science and Technology Research And Development Work.

Melbourne Australia Tier 1 Computer IT Management Business Support Subscription Service Laboratory Opportunity - Capital Investor & Core Team Members

Business Outsourced Tier 1 Computer Laboratoy - Managing All Electronics, And Computer Systems - Hardware, Formware and Software Application Deployments.

Tier 1 Computer Scientist and Engineer Founder Offering Investor And Core Team Member Opportunity

Contact:

COASMailBox @ gmail.com


2017 REVIEW

Arduino Character Analysis

ADVANCED MICRONTROLLER LOGIC PROGRAMMING CHAR ANALYSIS

2018 FEB | by Gene Casanova

Senior Systems Engineer


String Character Analysis

Operators enable getting the type of character; ASCII, upper case, numeric, a punctuation mark, etc.. The options available cover a variety of situations.

The example Arduino sketch below,produces a program to dmeostrate the functionality and capabilities of string character analysis. Compile, and upload the sketch to an Arduino UNO. The program waits for a character to be received at the serial port. Every chracter sent from the Arduino Software (IDE) Monitor, to the Arduino, is analysed by the program, and returns all available-information about it. A single character may meet more than one logic condition, yielding multiple answers for a single entry.


Available Operators

isAlphaNumeric()
Is alphanumeric?

Character Analysis Demonstration Sketch

Complie and upload this sketch to an Arduino UNO.

Open the Arduino Software (IDE) Monitor, and enter 1 character, then click 'Send'.

/* 2018
 * Arduino UNO Character Analysis Operators
 *
 * By Gene Casanova
 *
 * Character Analysis Operator Examples
 *
 * 1) Open Arduino IDE Monitor
 * 2) Enter a character
 * 3) Arduino will return all known information about the character.
*/
void setup() {
  // Open Serial Communications And Wait For Port To Open:
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for serial port to connect. Needed for native USB port only
  }

  // send an intro:
  Serial.println("Arduino Character Analysis");
  Serial.println("Enter a character:");
  Serial.println();
}

void loop() {
  // Get incoming byte:
  if (Serial.available() > 0) {
    int thisChar = Serial.read();

    // say what was sent:
    Serial.print("Received: \'");
    Serial.write(thisChar);
    Serial.print("\nASCII Value: ");
    Serial.println(thisChar);

    // analyze what was sent:
    if (isAlphaNumeric(thisChar)) {
      Serial.println("Alphanumeric");
    }
    if (isAlpha(thisChar)) {
      Serial.println("Alphabetic");
    }
    if (isAscii(thisChar)) {
      Serial.println("ASCII");
    }
    if (isWhitespace(thisChar)) {
      Serial.println("Whitespace");
    }
    if (isControl(thisChar)) {
      Serial.println("A Control Character");
    }
    if (isDigit(thisChar)) {
      Serial.println("A Numeric Digit");
    }
    if (isGraph(thisChar)) {
      Serial.println("A printable character; and not a whitespace.");
    }
    if (isLowerCase(thisChar)) {
      Serial.println("Lower Case");
    }
    if (isPrintable(thisChar)) {
      Serial.println("Printable");
    }
    if (isPunct(thisChar)) {
      Serial.println("A Punctuation");
    }
    if (isSpace(thisChar)) {
      Serial.println("A Space Character");
    }
    if (isUpperCase(thisChar)) {
      Serial.println("Upper Case");
    }
    if (isHexadecimalDigit(thisChar)) {
      Serial.println("A Valid Hexadecimaldigit (i.e. 0 - 9, a - F, or A - F)");
    }

    Serial.println();
    Serial.println("Enter a character:");
    Serial.println();
  }
}

Use The Technology Wisely & Keep It Simple

- Cheers!

Gene Casanova


Need More?   Need Help? ........Software, Network, System & Data Center Builder & Developer | Development Services Available - Freelance Small Jobs; To Outsourced Long Term Service Provider Contract Labor Available.

CGI Computer Wares | EST 1979

Send E-MailCONTACT: [click]@CGIComputerWares.com