|
Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs * Basic Loops * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory * A Simple Hi-Fi PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt |
(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login PmWiki /
MarkupExpressions(:Summary: PmWiki group header. Includes styles and trail.:) (:comment please leave the multiple style definitions concatenated as a single line. Linebreaks do appear in the output when the wiki is configured with linebreaks enabled -- thanks!:) (:comment included in PmWiki localisation headers and footers :) authors (advanced)
(:nl:)(:Summary:String and formatting operations:)
(:Audience: authors (advanced) :) The ''substr''The "substr" expression extracts portions of a string. The arguments are # the string to be processed. Always quote the string to be processed. # the initial position of the substring. Note that the initial position argument is zero-based (i.e., the first character is referenced via a "0"). # the number of characters to extract
To obtain the last n characters of a string use ''ftime''"Ftime" expressions are used for date and time formatting. The generic form is -> where ''fmt'' is a formatting string and ''when'' is the time to be formatted. The arguments can be in either order and may use the optional "fmt=" and "when=" labels. The "tz" (time zone) argument allows the setting of a different time zone, only available on installations running PHP 5.1 or newer. See the list of supported time zones, any value not found there will be silently ignored. The "locale" (language locale) argument allows the time format to be printed in a different language for names of weekdays and months, as long as that language locale is available on the server. You can set different locales to try, separated with commas or spaces, for example "fr_FR.utf8,fr_FR,fr". If none of the listed locales is available, the argument is silently ignored. With international locales, if you see weird characters, try adding or removing the ".utf8" or ".UTF-8" part of the locale, e.g. try both "fr_FR.utf8" and "fr_FR" to see which one works for you. Wikis with UTF-8 enabled are more likely to need the ".utf8" part. Examples:
The ''fmt'' parameter is whatever is given by "fmt=", the first parameter containing a '%', or else the site's default. The formatting codes are described at http://php.net/strftime. In addition to those, '%F' produces ISO-8601 dates, and '%s' produces Unix timestamps. Some common formatting strings: %F # ISO-8601 dates "2026-03-03"
%s # Unix timestamp "1772499286"
%H:%M:%S # time as hh:mm:ss "00:54:46"
%m/%d/%Y # date as mm/dd/yyyy "03/03/2026"
"%A, %B %d, %Y" # in words "Tuesday, March 03, 2026"
The ''when'' parameter understands many different date formats. The when parameter is whatever is given by "when=", or whatever parameter remains after determining the format parameter. Some examples: 2007-04-11 # ISO-8601 dates
20070411 # dates without hyphens, slashes, or dots
2007-03 # months
@1176304315 # Unix timestamps (seconds since 1-Jan-1970 00:00 UTC)
now # the current time
today # today @ 00:00:00
yesterday # yesterday @ 00:00:00
"next Monday" # relative dates
"last Thursday" # relative dates
"-3 days" # three days ago
"+2 weeks" # two weeks from now
'''Note:''' If you want to convert a Unix timestamp you '''must''' prefix with the @. Thus, The ''when'' parameter uses PHP's strtotime function to convert date strings according to the GNU date input formats; as of this writing it only understands English phrases in date specifications. The variable ''strlen''The "strlen" expression returns the length of a string. The first argument is the string to be measured.
''rand''The "rand" expression returns a random integer. The first argument is the minimum number to be returned and the second argument is the maximum number to be returned. If called without the optional min, max arguments rand() returns a pseudo-random integer between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for example, use (rand 5 15).
''mod''The advanced "mod" expression returns the modulo (remainder) of the division of two numbers. It may be used in advanced PageList templates together with
''toupper'' / ''tolower''The "toupper" and "tolower" expressions convert a string into uppercase or lowercase. The first argument is the string to be processed.
''ucfirst'' / ''ucwords''The "ucfirst" expression converts to uppercase the first character of the string, and "ucwords", the first character of each word. The first argument is the string to be processed.
''pagename''The "pagename" expression builds a pagename from a string. The first argument is the string to be processed.
''asspaced''The "asspaced" expression formats wikiwords. The first argument is the string to be processed.
Nesting expressionsMarkup expressions can be nested. Omit the curly braces for the inner expressions:
Notes* For PmWikis version 2.2.33 or older, the string-processing expressions may not work properly on multibyte UTF-8 characters. Newer versions should work fine. See also* Page variables, Page text variables * Conditional markup * Cookbook:MarkupExpressionSamples — '-custom markup expression samples-' * Cookbook:MarkupExprPlus(:nl:)(:Summary:Trail and talk page links:) (:comment included in PmWiki localisation headers and footers :) <<? >>bgcolor=#ffe border-top="1px solid black" font-size=.8em<< This page may have a more recent version on pmwiki.org: PmWiki:MarkupExpressions, and a talk page: PmWiki:MarkupExpressions-Talk. >><< |
(:Summary: Website page footer:)
Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login
Page last modified on December 15, 2018, at 07:44 AM