# SFBWiring.h File Reference

SFB versions of the basic Arduino/Wiring functions. More...

`#include "SFBTypes.h"`
`#include "SFBConstants.h"`
`#include "SFBPins.h"`
`#include "lpc/timer.h"`

Include dependency graph for SFBWiring.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
void | digitalWrite (int sfbPin, int value)
| Set a pin's value.
int | digitalRead (int sfbPin)
| Read a pin's value.
void | ledOn (int sfbPin)
| Turn on one of the SFB built-in LEDs.
void | ledOff (int sfbPin)
| Turn off one of the SFB built-in LEDs.
void | ledSet (int sfbPin, bool on)
| Turn on or off one of the SFB built-in LEDs.
bool | ledIsOn (int sfbPin)
| Check if one of the SFB built-in LEDs is on or off.
void | ledToggle (int sfbPin)
| Toggle one of the SFB built-in LEDs.
void | pinMode (int sfbPin, int mode)
| Set a pin's function to input or output.
u32 | isPinMode (int sfbPin, int mode)
| SFB extension: Check if a pin is currently an input or an output (or under reflex control).
void | delayMicroseconds (u32 usecondsToWait)
| Delay for some number of microseconds.
void | delayMicrosecondsApproximate (u32 usecondsToWait)
void | delay (u32 millissecondToWait)
| Delay for some number of milliseconds.
void | shiftOut (int dataPin, int clockPin, int bitOrder, u8 val)
u32 | pulseIn (int pin, int state, u32 timeoutUsec=1000000)

## Detailed Description

SFB versions of the basic Arduino/Wiring functions.

Author:
  David H. Ackley.

Date:
  (C) 2008 All rights reserved.

Code License:
  The GNU Lesser General Public License

License Note:
  All code samples shown in documentation are placed into the public domain.

## Function Documentation

void digitalWrite | ( | int | sfbPin,
|  | int | value |
| ) |  |  |

Set a pin's value.

Also used to set the pullup (or pulldown) resistors on input pins.

Examples:
  blinky.cpp, and blinkySync.cpp.

u32 isPinMode | ( | int | sfbPin,
|  | int | mode |
| ) |  |  |

SFB extension: Check if a pin is currently an input or an output (or under reflex control).

Parameters:

  | mode | Either INPUT or OUTPUT for basic usage. Can also be REFLEX_MODE to check if a pin is in reflex mode (rather than checking if it's an input or an output).

Returns:
  Non-zero if mode is INPUT and sfbPin is currently an input pin, or if mode is OUTPUT and sfbPin is currently an output pin, or if mode is REFLEX_MODE and sfbPin is currently under reflex control; and returns 0 otherwise.

Blinks:
  E_API_ARGUMENT if mode is not INPUT, OUTPUT, or REFLEX_MODE

Blinks:
  E_API_BAD_PIN if sfbPin is not a valid pin

Since:
  0.9.11

bool ledIsOn | ( | int | sfbPin | ) | `[inline]`

Check if one of the SFB built-in LEDs is on or off.

Returns:
  `true` if the sfbPin is on, `false` otherwise

Examples:
  buttonled2.cpp.

void pinMode | ( | int | sfbPin,
|  | int | mode |
| ) |  |  |

Set a pin's function to input or output.

SFB extension: Set to 'reflex mode'.

Examples:
  blinky.cpp, and blinkySync.cpp.