« Validate electronic i… | Home | Connect to Postgres i… »

XDevMag: Phidgets

What are they and how to use them

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.3 issue:

This article introduces readers to Phidgets, small input/output devices developed by Phidgets Inc. that can be used for a variety of applications such as sensors for humidity, light, pressure, temperature, and more. The article explains how to connect these devices to a computer through hubs, either wired or wireless, and how the MBS Xojo plugin can facilitate interaction between Phidgets and Xojo software. The author walks through the process of creating a weather station with a light sensor, barometer, and temperature sensor, demonstrating how to gather data from these sensors and display it in a Xojo interface.

The setup for working with Phidgets involves connecting them to the computer through hubs, with each hub offering multiple ports. In a Xojo project, the layout includes elements like label fields to display data from sensors and buttons to control the program. The author walks through the process of adding a library for Phidgets in the program, ensuring that the necessary code is in place to load and use the library for communication between Xojo and the Phidgets hardware. This is followed by a demonstration of how to initialize and configure the sensors using specific Phidget classes and handle events triggered by sensor data changes.

Finally, the article explores how to control data updates from sensors to avoid unnecessary changes being triggered too frequently. This is accomplished by adjusting properties such as data interval and change triggers to control when events are fired based on meaningful changes in sensor data. The program includes a button to close the Phidgets connection properly and end the session. The article concludes with a reminder of the steps taken, providing a comprehensive guide for readers interested in integrating Phidgets with Xojo for hardware interfacing projects.

see Phidgets plugin and Phidgets classes.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

18 02 25 - 13:00