Syntax, Example, Min( ) built-in function – Echelon Neuron C User Manual

Page 131: Msec_delay( ) function

Advertising
background image

Neuron C Reference Guide

111

Syntax

void memset (void *

p

, int

c

, unsigned long

len

);

Example

unsigned target[20];

void f(void)
{

memset(target, 0, sizeof(target));

}

min( )

Built-in Function

The min( ) built-in function compares

a

and

b

and returns the smaller value. The

result

type

is determined by the types of

a

and

b

, as described for max( ) on page

107.

Syntax

type

min (

a

,

b

);

Example

int a, b, c;
long x, y, z;

void f(void)
{

a = min(b, c);

x = min(y, z);

}

msec_delay( )

Function

The msec_delay( ) function allows an application to suspend processing for a time

interval specified by

milliseconds

. The maximum delay is 255 ms. This function

provides more precise timing than can be achieved with application timers, and

provides an easier way to specify millisecond delays than the delay( ) or

scaled_delay( ) functions. See delay( ) and scaled_delay( ) for functions that can
delay the application program for a longer duration.

Syntax

void msec_delay(unsigned short

milliseconds

);

milliseconds

A number of milliseconds to delay (max of 255 ms).

Example

IO_4 input bit io_push_button;
boolean debounced_button_state;

Advertising