Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

WiringPiMBS.piUnlock(Key as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Unlocks a synchronization lock.
Notes:
These allow you to synchronise variable updates from your main program to any threads running in your program. keyNum is a number from 0 to 3 and represents a “key”. When another process tries to lock the same key, it will be stalled until the first process has unlocked the same key.

You may need to use these functions to ensure that you get valid data when exchanging data between your main program and a thread – otherwise it’s possible that the thread could wake-up halfway during your data copy and change the data – so the data you end up copying is incomplete, or invalid.

Feedback, Comments & Corrections

WiringPiMBS.pullUpDnControl(pin as Integer, pud as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This sets the pull-up or pull-down resistor mode on the given pin, which should be set as an input.
Notes:
Unlike the Arduino, the BCM2835 has both pull-up an down internal resistors. The parameter pud should be; kPUD_OFF, (no pull up/down), kPUD_DOWN (pull to ground) or kPUD_UP (pull to 3.3v) The internal pull up/down resistors have a value of approximately 50KΩ on the Raspberry Pi.

This function has no effect on the Raspberry Pi’s GPIO pins when in Sys mode. If you need to activate a pull-up/pull-down, then you can do it with the gpio program in a script before you start your program.

Feedback, Comments & Corrections

WiringPiMBS.pwmSetClock(divisor as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This sets the divisor for the PWM clock.

Feedback, Comments & Corrections

WiringPiMBS.pwmSetMode(mode as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: The PWM generator can run in 2 modes – “balanced” and “mark:space”.
Notes: The mark:space mode is traditional, however the default mode in the Pi is “balanced”. You can switch modes by supplying the parameter: kPWM_MODE_BAL or kPWM_MODE_MS.

Feedback, Comments & Corrections

WiringPiMBS.pwmSetRange(range as UInt32)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This sets the range register in the PWM generator.
Notes: The default is 1024.

Feedback, Comments & Corrections

WiringPiMBS.pwmToneWrite(pin as Integer, value as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Writes a tone.

Feedback, Comments & Corrections

WiringPiMBS.pwmWrite(pin as Integer, value as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Writes the value to the PWM register for the given pin.
Notes:
The Raspberry Pi has one on-board PWM pin, pin 1 (BMC_GPIO 18, Phys 12) and the range is 0-1024. Other PWM devices may have other PWM ranges.

This function is not able to control the Pi’s on-board PWM when in Sys mode.

Feedback, Comments & Corrections

WiringPiMBS.Read(fd as Integer, count as UInt64) as Memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Read attempts to read count bytes of data from the object referenced by the descriptor fildes into a buffer.
Notes:
Returns the memoryblock on success (if we got more than zero bytes).
Errno is set in case of error.

Feedback, Comments & Corrections

WiringPiMBS.serialClose(fd as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Closes the device identified by the file descriptor given.

Feedback, Comments & Corrections

WiringPiMBS.serialDataAvail(fd as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Returns the number of characters available for reading, or -1 for any error condition, in which case errno will be set appropriately.

Feedback, Comments & Corrections

WiringPiMBS.serialFlush(fd as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This discards all data received, or waiting to be send down the given device.

Feedback, Comments & Corrections

WiringPiMBS.serialGetchar(fd as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Returns the next character available on the serial device.
Notes: This call will block for up to 10 seconds if no data is available (when it will return -1)

Feedback, Comments & Corrections

WiringPiMBS.serialOpen(device as String, Baud as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This opens and initialises the serial device and sets the baud rate.
Notes: It sets the port into “raw” mode (character at a time and no translations), and sets the read timeout to 10 seconds. The return value is the file descriptor or -1 for any error, in which case errno will be set as appropriate.

Feedback, Comments & Corrections

WiringPiMBS.serialPutchar(fd as Integer, c as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Sends the single byte to the serial device identified by the given file descriptor.

Feedback, Comments & Corrections

WiringPiMBS.serialPutData(fd as Integer, data as Memoryblock)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Sends the nul-terminated string to the serial device identified by the given file descriptor.
Notes: This sends text with any encoding.

Feedback, Comments & Corrections

WiringPiMBS.serialPuts(fd as Integer, text as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Sends the nul-terminated string to the serial device identified by the given file descriptor.
Notes: This sends text with UTF-8 encoding.

Feedback, Comments & Corrections

WiringPiMBS.setPadDrive(group as Integer, value as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This sets the “strength” of the pad drivers for a particular group of pins.
Notes: There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing.

Feedback, Comments & Corrections

WiringPiMBS.SPIDataRW(channel as Integer, data as Memoryblock) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This performs a simultaneous write/read transaction over the selected SPI bus.
Notes:
Data that was in your buffer is overwritten by data returned from the SPI bus.

That’s all there is in the helper library. It is possible to do simple read and writes over the SPI bus using the standard read() and write() system calls though – write() may be better to use for sending data to chains of shift registers, or those LED strings where you send RGB triplets of data. Devices such as A/D and D/A converters usually need to perform a concurrent write/read transaction to work.

Feedback, Comments & Corrections

WiringPiMBS.SPIGetFd(channel as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Queries the file descriptor for a channel.

Feedback, Comments & Corrections

WiringPiMBS.SPISetup(channel as Integer, speed as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This is the way to initialise a channel (The Pi has 2 channels; 0 and 1).
Notes:
The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz.

The returned value is the Linux file-descriptor for the device, or -1 on error. If an error has happened, you may use the standard errno global variable to see why.

Feedback, Comments & Corrections

WiringPiMBS.SPISetupMode(channel as Integer, speed as Integer, mode as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This is the way to initialise a channel (The Pi has 2 channels; 0 and 1).
Notes:
The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz.

The returned value is the Linux file-descriptor for the device, or -1 on error. If an error has happened, you may use the standard errno global variable to see why.

Feedback, Comments & Corrections

WiringPiMBS.wiringPiSetup as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Initializes the library.
Notes:
This initialises wiringPi and assumes that the calling program is going to be using the wiringPi pin numbering scheme. This is a simplified numbering scheme which provides a mapping from virtual pin numbers 0 through 16 to the real underlying Broadcom GPIO pin numbers. See the pins page for a table which maps the wiringPi pin number to the Broadcom GPIO pin number to the physical location on the edge connector.

This function needs to be called with root privileges.

One of the setup functions must be called at the start of your program or your program will fail to work correctly. You may experience symptoms from it simply not working to segfaults and timing issues.

Feedback, Comments & Corrections

WiringPiMBS.wiringPiSetupGpio as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Initializes the library.
Notes:
This is identical to wiringPiSetup, however it allows the calling programs to use the Broadcom GPIO pin numbers directly with no re-mapping.

As above, this function needs to be called with root privileges, and note that some pins are different from revision 1 to revision 2 boards.

One of the setup functions must be called at the start of your program or your program will fail to work correctly. You may experience symptoms from it simply not working to segfaults and timing issues.

Feedback, Comments & Corrections

WiringPiMBS.wiringPiSetupPhys as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Initializes the library.
Notes:
Identical to wiringPiSetup, however it allows the calling programs to use the physical pin numbers on the P1 connector only.

As above, this function needs to be called with root priviliges.

One of the setup functions must be called at the start of your program or your program will fail to work correctly. You may experience symptoms from it simply not working to segfaults and timing issues.

Feedback, Comments & Corrections

WiringPiMBS.wiringPiSetupSys as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Initializes the library.
Notes:
This initialises wiringPi but uses the /sys/class/gpio interface rather than accessing the hardware directly. This can be called as a non-root user provided the GPIO pins have been exported before-hand using the gpio program. Pin numbering in this mode is the native Broadcom GPIO numbers – the same as wiringPiSetupGpio() above, so be aware of the differences between Rev 1 and Rev 2 boards.

Note: In this mode you can only use the pins which have been exported via the /sys/class/gpio interface before you run your program. You can do this in a separate shell-script, or by using the system() function from inside your program to call the gpio program.

Also note that some functions have no effect when using this mode as they’re not currently possible to action unless called with root privileges. (although you can use system() to call gpio to set/change modes if needed)

One of the setup functions must be called at the start of your program or your program will fail to work correctly. You may experience symptoms from it simply not working to segfaults and timing issues.

Feedback, Comments & Corrections

WiringPiMBS.wpiPinToGpio(wpiPin as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: This returns the BCM_GPIO pin number of the supplied wiringPi pin.
Notes: It takes the board revision into account.

Feedback, Comments & Corrections

WiringPiMBS.Write(fd as Integer, data as Memoryblock) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method WiringPi MBS Linux Plugin 15.3 No No Yes Yes, Linux only No
Function: Write to a file descriptor.
Notes:
Write attempts to write bytes to the object referenced by the descriptor fildes from the memoryblock pointed to by data.
Upon successful completion the number of bytes which were written is returned. Otherwise, a -1 is returned and the global variable errno is set to indicate the error.

Feedback, Comments & Corrections

Previous items

The items on this page are in the following plugins: MBS Linux Plugin.

The biggest plugin in space...




Links
MBS FileMaker tutorial videos