Enter Your Project for a chance to win a grand prize for the most innovative use of Arduino or a $200 shopping cart! The Birthday Special: Arduino Projects for Arduino Day! | Project14 Home | |
Monthly Themes | ||
Monthly Theme Poll |
To celebrate Project 14's birthday, I'm going to make a programmable switch with an Arduino UNO. In this post I try out the SCPI library. |
SCPI Library Installation
I'm using a SCPI lib that's written for Arduino: Open Instrument Control.
You can download the GIT archive as a zip.
To install it in the Arduino environment, first check in the Arduino gui where your sketchbook folder is (Via File -> Preferences).
Extract the GIT archive in a temporary location. Copy the src/ArduinoSCPIParser folder to the sketchbook/libraries subfolder
On my PC: D:\users\jancu\Documents\Arduino\libraries\ArduinoSCPIParser.
You'll have to comment out one line in the scpiparser.cpp source, or you get compilation errors:
// #include <WProgram.h>
This is because the SCPI library we're using isn't adapted to the recent Arduino software versions.
Test the SCPI Library
There are two examples in the SCPI lib. We're using Meter.ino.
Open the example in the Arduino GUI (File -> Open, then navigate to the place where you extracted the GIT archive and open src/Examples/Meter/Meter.ino).
Connect your UNO, select Tools -> Board -> Arduino/Genuino UNO.
Select Tools -> Port -> <the COM port of your Arduino>.
Select Sketch -> Upload.
Your Arduino is now programmed with the Meter example and the SCPI lib.
To test the basic setup, open the serial monitor:
Tools -> Serial Monitor
Enter the SCPI command *IDN? and press Send.
The monitor should log the result: OIC,Embedded SCPI Example,1,10.
Top Comments