Beruflich Dokumente
Kultur Dokumente
AUTHOR
Jason Linker
myRIO
This handbook will get you up to speed on the basics of the National Instruments myRIO, including initial
setup, hardware, software, and configuration.
NI myRIO
myRIO power cord
myRIO USB cord
Various power adapters (for international use)
Mini System Port (MSP) Screw-Terminal
Connector
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 1/57
1/30/2017 myRIO | Tufts Maker Network
myRIO Software
First you need to create an account here (you must your your university account to get a student license).
To work with myRIO you will need the latest myRIO Software Bundle
The myRIO Toolkit is compatible with 32-bit WINDOWS LabVIEW only. Therefore, you must have 32-bit
Windows LabVIEW installed even if you use a 64-bit operating system.
LabVIEW
LabVIEW RIO (Reconfigurable I/O)
LabVIEW RT (Real Time)
LabVIEW FPGA (Field Programmable Gate Array)
NI RIO Drivers
Various other optional LabVIEW and RIO drivers depending on intended use
If your computer does not have a built in .iso reader (a virtual CD drive) you can find one online. I used
Virtual Clonedrive and it worked fine.
National Instruments will ask you to activate your license. The evaluation copy will work for about 30
days, but student licenses are rather inexpensive and last for six months from the purchase date.
There will mostly likely be a lot of updates and patches for the software. If you run into updating issues,
some updates are dependent on others and need to be installed separately.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 2/57
1/30/2017 myRIO | Tufts Maker Network
0:00 / 7:37
The first time you plug in the myRIO via USB a USB Monitor Window will
appear. Launch the getting started wizard. The wizard will update and install
the newest software onto your myRIO. (The myRIO runs its own Linux based
LabVIEW and other software.) When it restarts the device and the menu
reappears click "do nothing" a few times. Eventually you will be able to test
the on-board LEDs button and accelerometer.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 3/57
1/30/2017 myRIO | Tufts Maker Network
Use this window to test the myRIO's onboard devices. There is an accelerometer, button, and 4 LEDs.
Configuring myRIO
0:00 / 6:39
Every time you plug in the myRIO the USB Monitor will appear. If you click on the "Configure NI myRIO"
tab you will be brought to a locally hosted site. (You may need to install Microsoft Silverlight and restart
your web browser). Here you can see and adjust a lot of the settings for your myRIO.
For now, all you need to know is the name and current IP address (most likely your USB port's IP
address) for your myRIO. For more details on configuring the myRIO see below.
System Configuration (Change the name of the myRIO, adjust the startup settings, and see what is
connected to the myRIO)
File Browser (Load/unload files from the myRIO)
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 4/57
1/30/2017 myRIO | Tufts Maker Network
The following guide will help you create an LED level using an accelerometer. The myRIO has an onboard
accelerometer, 4 built in LEDs, and a button which will be used in this guide to create a level along the Y-
axis. The LEDs should indicate how far from level the device is and in which direction a user should rotate
it to make it level. (Assume the X and Z axis are stable). How can you best use the 4 onboard LEDs to
accomplish this?
If you have never used LabVIEW please refer to the Introduction to LabVIEW section.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 5/57
1/30/2017 myRIO | Tufts Maker Network
0:00 / 3:13
2. Right click on Project (the top line) -> New -> Targets and Devices -> New Target or device -> myRIO-
1900. Then choose your myRIO.
3. Right click on myRIO in the project -> properties -> add IP address (enter the current connection IP
address (USB or WiFi IP address))
4. Last, create a new VI on the real time processor (this will use the default FPGA identity). Right click on
RT Target -> New -> VI
In the bottom left corner of the VI it should say the project name and your myRIO. If it does not, right click
the bottom left and select your myRIO.
A video of this process (done with compact RIO) can be found in the sidebar.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 6/57
1/30/2017 myRIO | Tufts Maker Network
0:00 / 3:17
(HINT to display multiple plots on one set of axis use a cluster. Each element inside the cluster will graph
as its own line.)
0:00 / 3:26
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 7/57
1/30/2017 myRIO | Tufts Maker Network
Use the myRIO accelerometer express VI and a loop to plot live data (every 10
ms) for all 3 axis on a graph. Use a stop button as a control to exit the loop
and end the program. This is a plot of the
accelerometer data from the
To continually take in accelerometer data we need to repeat the same code myRIO.
over and over again. For this repetition use a while loop.
If you are struggling download partial-solution.vi and it will walk you though the gathering data process.
Solution
The while loop will run until the stop button is
pressed. The loop will wait 10ms between each
cycle. During each cycle the accelerometer will
read a value for each axis and then graph all three
on one plot.
Here you can see the accelerometer data flowing into the
waveform chart. Also the loop will exit when the stop
button is pressed.
The myRIO has 4 built in LEDs and a button. For this project the express VIs will be sufficient but more
LED information is located here and more information on buttons is located here.
0:00 / 4:25
Solution
The output of the button is a boolean and so is the input of the LED control. The pacing of the loop will
determine how fast the response time is.
LED-on-off1.vi
LED-on-off2.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 9/57
1/30/2017 myRIO | Tufts Maker Network
Here you can see the boolean values flowing through the VI. Notice how highlight execution slows down the
program. The loop will exit when the stop button reads true.
This solution uses myRIO channels. This is slightly more complicated and hidden
behind every express VI.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 10/57
1/30/2017 myRIO | Tufts Maker Network
However, the VI is not assembled. Drag the blocks into their correct locations and wire them up to create
a runnable VI.
partial-solution-all-level.vi
The graph will plot live data. If the x, y, and z axis are all
"level" then the virtual LED will light up.
Solution
Each of the axis' data is fed into a case structure to determine if that axis is level. If all are level, the LED
will turn on. The axis' data is multiplied by a scalar constant because case structures will not take
decimals. The default cases are when the myRIO is level.
is-level1.vi
is-level2.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 11/57
1/30/2017 myRIO | Tufts Maker Network
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 12/57
1/30/2017 myRIO | Tufts Maker Network
This solution uses myRIO channels. The channels are hidden behind express VIs but the overall structure of the
solution is the same as solution 1.
Progressive Level
Now we should be able to put all of this together to accomplish the original goal.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 13/57
1/30/2017 myRIO | Tufts Maker Network
The graph will plot live data. It will also mimic the LEDs on the myRIO to show how level the
device is.
Solution
These are two solutions to this activity. The first evaluates the axis data and enters the respective case
structure. Each case has a specific LED configuration.
progressive-level1.vi
progressive-level2.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 14/57
1/30/2017 myRIO | Tufts Maker Network
This shows the different cases in the case structure. As the myRio is less level, more LEDs turn
on. This method is rather inefficient as it requires an express VI in each case.
This shows the different cases in the case structure. As the myRio is less level, more LEDs turn on. This solution uses
math to simplify the LED selection.
The second method has a case for positive and a case for negative. It then does division to determine
which lights should turn on.
Going further
Visit Dr. E's Challenges to upload your own level solutions, and see how others approached this project.
Here are some other cool project ideas that use the same basic principles as the level you've completed.
What happens when you bump the myRIO on a table? How can you display that?
Can you use the button to "zero" the level (turn whatever the current position is to "level")?
What angle is the myRIO at?
This project details how to build a binary counter. When counting in binary there are only two values:
TRUE (1) and FALSE (0). Using a combination of these values and some clever logic we can create any
number. We will create a series of places, each holding its own value (bit). The first will represent 2^0
(convenient because computer science almost always starts counting at 0), the second will be 2^1, then
2^2, etc. This will give us the series 1 2 4 8 etc. This means that we could count up to 15 with a 4 bit
system if we add up all of the represented values.
In order to remember a value from the last loop iteration, LabVIEW uses shift registers. This will allow you
to keep track of values from the last loop iteration so you can keep track of the current time remaining.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 16/57
1/30/2017 myRIO | Tufts Maker Network
0:00 / 3:00
If you need help, the partial-solution.vi file is missing some parts of the complete solution. It contains all
the needed structures, controls, and indicators; but none of the operations and logic.
counter-partial-solution.vi
This is the user interface for the count down timer. A dial displays the time remaining
and and LED displays if time has run out.
Solution
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 17/57
1/30/2017 myRIO | Tufts Maker Network
The user control can be trigger via either a switch statement or a case structure. The gauge is simply an
indicator and the loop subtracts one from the remaining time with every cycle. When the remaining time
is 0 an LED turns on and the program exits the loop.
countdown-timer1.vi
countdown-timer2.vi
This solution uses a switch statement instead of a case structure to determine whether or not to enter the
countdown loop. The button will only affect the program if it is not counting down.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 18/57
1/30/2017 myRIO | Tufts Maker Network
This solution uses a case structure instead of a switch statement to determine whether or not to enter the
countdown loop. The false case contains a false constant to wire to the stop condition.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 19/57
1/30/2017 myRIO | Tufts Maker Network
There are two easier ways to approach this problem and many other more complicated solutions.
Other more complicated solutions include but are not limited to bit-shifting and boolean operations.
Solution
Every second, the count increases. It checks if it is divisible by 8, if it is it subtracts 8; and so on with 4, 2,
and 1. This is possible to do with either integer division or a modulus operator.
The reseting can either be done with a loop (exit the count-up loop and restart) or a switch statement
(the current time switches to 0)
binary-counter-countup-clock1.vi
binary-counter-countup-clock2.vi
The quotient and remainder tool works like a modulus function. A series of cases structures determine which LEDs to
light up.
There is no integer division function in LabVIEW. You can create integer division by dividing and rounding down
[toward -infinity]. A series of cases structures determine which LEDs to light up.
Going Further
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 21/57
1/30/2017 myRIO | Tufts Maker Network
Visit Dr. E's Challenges to upload your own binary counter solutions, and see how others approached this
project.
Here are some other cool project ideas that use the same basic principles as the binary counter.
In this project you will build a smart night light. The darker in the room it gets, the brighter the light will
get.
This will be the first project using the myRIO expansion ports.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 22/57
1/30/2017 myRIO | Tufts Maker Network
[L to R] the Mini System Port and breadboard, the myRIO expansion port and wirewrap, and the digilent myProto
accessory board.
In the picture (L to R), there is an MSP port and protoboard (breadboard), an MXP wirewrap (comes with
myRIO), and a Digilent myProto accessory board. Any of these will work and you will find some of these
options better for certain projects than others.
The MXP options are great for specialized tasks with custom boards or applications needing a lot of pins,
you will mostly likely also need to pair it with a protoboard. The MSP myProto is great because it
converts all the screw connections into "breadboard pins" and has kill switches for 5V and +/-15V. Any
protoboard will also work with the MSP port, you just have screw in the wires yourself.
For convenience and ease of use I will use various Digilent boards throughout this tutorials.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 23/57
1/30/2017 myRIO | Tufts Maker Network
section of the toolkit on the block diagram. Be careful about which pins you select to read and write to.
Solution
The button outputs a boolean and the digital write takes a boolean so they can be simply wired together.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 24/57
1/30/2017 myRIO | Tufts Maker Network
Solution
The button outputs a boolean value but the analog write takes a double precision number. To convert
this, use a switch statement. When true...When false...
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 25/57
1/30/2017 myRIO | Tufts Maker Network
If you want to control the brightness precisely using the myRIO or a computer you will have to use a
technique called pulse width modulation (PWM). PWM is essentially a digital output. By oscillating
between true and false the output looks like a "square wave". By changing the percent of time high and
low you can create different brightnesses. This is called the duty cycle, and it generally will vary as a
decimal between 0 and 1 or as a percentage between 0 and 100. The higher the duty cycle the longer the
light is on in each given HIGH-LOW cycle. Be sure you use a high enough frequency so you don't end up
with a strobe light!
Solution
There is a convenient ExpressVI for PWM. Simply specify the pin and control the frequency and duty
cycle.
real-time-dimming-pwmrt1.vi
real-time-dimming-pwmrt2.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 26/57
1/30/2017 myRIO | Tufts Maker Network
This uses an express VI and the default FPGA to create a PWM signal on DIO3.
This is the basics of a PWM signal. it is all located on the real time processor and the default FPGA personality.
00:27 / 11:39
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 27/57
1/30/2017 myRIO | Tufts Maker Network
(NOTE: If using a standard non-student/non-educational license you get 1 year of free cloud compile.)
(NOTE: If local compile is not working or it says "cannot find host" then you need to download Vivado
Tools.)
This activity can be done using two controls (a high count and low count) or
This is a basic schematic to
one control and a local variable. If you chose the second method you may see the effect of PWM on
also need to establish a total count or a maximum count. A PWM signal can DIO3 on an LED.
Solution
The flat sequence method is more straightforward. Make the pin true, wait, make it false and then wait
again. Each time can be decided independently or one can be a function of the other.
The counter method uses a threshold. The counter will increase linearly until the max value, then drop to
0. If we set a threshold somewhere along that linear path we can control how long it is true vs false. Be
careful with you comparison logic if using this method.
fpga-dimming-pwmfpga1.vi
fpga-dimming-pwmfpga2.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 28/57
1/30/2017 myRIO | Tufts Maker Network
This uses a flat sequence and wait commands to create a pwm signal on DIO3.
This uses a counter. If counts from 0 to the maximum specified value. If the "count
on" is less than the "current count" the LED will be off until the "current count"
passes the "count on".
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 29/57
1/30/2017 myRIO | Tufts Maker Network
NOTE: If using the MSP port you have an AI0+ and an AI0-. You will measure in one (for measuring positive
or negative signals) and you must ground the other. If you are using the MXP port there are only AI0-AI3
so this is not an issue.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 30/57
1/30/2017 myRIO | Tufts Maker Network
This schematic uses a voltage divider a measures the voltage between the photoresistor and the LED.
Solution
The VI here is very straightforward, just analog read into a graph.
measuring-light-photoresistor.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 31/57
1/30/2017 myRIO | Tufts Maker Network
The analog input signal is a somewhat arbitrary value, so if it is easier you can multiply the analog signal
by 1.221 to convert it into volts. Below you will make the night light on the real time processor and the
FPGA.
This schematic uses a voltage divider a measures the voltage between the photoresistor and a constant resistor. It
has an LED connected to DIO3 which will output a PWM signal.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 32/57
1/30/2017 myRIO | Tufts Maker Network
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 33/57
1/30/2017 myRIO | Tufts Maker Network
Solution
Once the basic architecture for the night light is complete, the math should not be too difficult or
complex. Using the maximum and minimum values from the analog input convert accordingly to a value
between 0 and 1. A linear function works well for this.
night-light-realtime-main_rt.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 34/57
1/30/2017 myRIO | Tufts Maker Network
types of FPGA PWM signals you generated earlier. You should also make a real time VI that calls the FPGA
program so you do not need to recompile as often.
Solution
Depending on which way you prefer to code a PWM signal on the FPGA there are at least two options
here.
If you chose the sequence option you can filter the data to be within a certain range and then subtract
that lower bound. This will give data between 0 and the upper bound minus the lower bound. This can
then be used to generate a PWM.
If you are using the loop counter to generate the PWM filter the data the same way and then compare it
to the current loop counter. Be careful with your logic.
night-light-fpga-main_fpga1.vi
night-light-fpga-main_fpga2.vi
This uses the flat sequence to create a PWM signal. The high and low values can be calibrated according to the light
in the room. The input data is filtered to make sure it will not cause an error from being above or below the
SPACES HANDBOOKS EQUIPMENT MAKERS
calibrated values. GROUPS PROJECT S ABOUT
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 35/57
1/30/2017 myRIO | Tufts Maker Network
This uses the counter method to create a PWM signal. The high and low values can be calibrated according to
the light in the room. The data is filtered to make sure it will not cause a math error.
Going Further
Visit Dr. E's Challenges to upload your own smart night solutions, and see how others approached this
project.
Here are some other cool project ideas that use the same basic principles as the smart nightlight.
Analyzing data from different types resistor inputs (pressure, temperature, color, etc)
Changing colors of an RGB LED as input values change.
In this project you will create digital dice using a basic LED pixel matrix. When shaken the myRIO will
choose a random number, show a "thinking pattern", then display it like the face of a die on the LED
display.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 36/57
1/30/2017 myRIO | Tufts Maker Network
For this project we will need 9 digital outputs so you should use the MXP port. You can either use this
schematic and female header wires or the MXP wirewrap that comes with the myRIO or various other
expansion boards.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 37/57
1/30/2017 myRIO | Tufts Maker Network
Wire all the the cathodes (short end) to the same ground on your board. Then connect this to ground.
Each LED will connect to its own digital pin.
Use this to help wire the circuit if you are not using an MXP breakout board.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 38/57
1/30/2017 myRIO | Tufts Maker Network
NOTE: Replace the red wires with LEDs. Use this to create your own pixel matrix.
How can you tell when the device was shaken? Lets start with some basic accelerometer tests.
Activity: Triggering
Plot the accelerometer data as well as the sum of
each data stream. What happens when you shake
or bump the myRIO? How is it different from slowly
rotating the device?
Solution
A threshold of a combined 2G's of shaking/bumping the myRIO will trigger an action. Whenever the
combined accelerations are over that threshold the loop will end.
digital-dice-trigger-solution.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 39/57
1/30/2017 myRIO | Tufts Maker Network
NOTE - If you want a non-looping program to run continuously you can use
These are the 6 faces of a
the run continuously button located next to the run button (two curved
standard die that can be
arrows in a circle). recreated with LEDs.
Solution
A random number generator in LabVIEw will generate a decimal between 0 an 1, which is then scaled and
rounded to 1 to 6. This value is used in a case structure because every number has a distinct LED pattern.
digital-dice-faces-solution.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 41/57
1/30/2017 myRIO | Tufts Maker Network
Use these to create inputs and outputs and give the subVI
a custom icon.
Solution
In all of the examples all the LEDs are turned off, then it waits, then it thinks, then it displays, and so on.
SPACES HANDBOOKS EQUIPMENT MAKERS GROUPS PROJECT S ABOUT
The solution with the custom SubVIs is much cleaner and easier to follow. One of the examples uses a
flat sequence, the other uses boolean controls and indicators (data flow) to control the order of
execution.
digital-dice-main_messy.vi
digital-dice-main_middle.vi
digital-dice-main_simple.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 42/57
1/30/2017 myRIO | Tufts Maker Network
Without subVIs this code looks confusing, messy, and hard to follow.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 43/57
1/30/2017 myRIO | Tufts Maker Network
A boolean control and indicator for each subVI force the order
of execution similar to a sequence.
Going Further
Visit Dr. E's Challenges to upload your own digital dice solutions, and see how others approached this
project.
Here are some other cool project ideas that use the same basic principles as the digital dice.
You can use a row/column method to create displays with more LEDs than ports. For examples and
information on this click here.
In this handbook, you will use the audio in and audio out ports to create a loop station. You can record a
sample of sound and then layer more sound on top of it.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 44/57
1/30/2017 myRIO | Tufts Maker Network
Any standard stereo microphone should work, I used both a Chuenyun CY-502 from the myRIO starter kit
and a Rode VideoMic Pro.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 45/57
1/30/2017 myRIO | Tufts Maker Network
Microphones are capable of picking up sounds of all different frequencies, but humans are only capable
of hearing within a certain range.
Right click inside the chart and extend the chart length history to 4096 to remember more data points.
Also, turning off autoscale on the Y axis and choosing the upper and lower bounds may help to visualize
the sound waves.
Solution
Use a timed loop to take
SPACES in samples. This
HANDBOOKS will allow for a MAKERS
EQUIPMENT controllable constant
GROUPS rate. PROJECT
To trigger the
S timed
ABOUT
loop use either an event structure or a while loop with a case structure.
audio-loop-viewer.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 46/57
1/30/2017 myRIO | Tufts Maker Network
This is the block diagram for viewing audio waves. I found 100usec to be a good sampling rate.
Storing Data
To store data for this activity we can use an array.
The easiest way to fill an array is with a loop. When you create an indicator outside of the loop and
connect it to the data (indexed analog in) a small square will appear at the loop border. With this tunnel,
you can output the last value (solid box) or all of the values (bracketed box).
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 47/57
1/30/2017 myRIO | Tufts Maker Network
Solution
The use of an auto-indexing loop tunnel allows arrays to be created and indexed easily. There are also
data type conversions to work between arrays and double precision numbers.
Event structures
SPACES canHANDBOOKS
also be used. EQUIPMENT MAKERS GROUPS PROJECT S ABOUT
audio-loop-play-playback.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 48/57
1/30/2017 myRIO | Tufts Maker Network
Combining Audio
To combine audio data we can add the data
arrays. However, a sum operation of the two
arrays will not work. Instead each element needs
to be summed with its corresponding element
from the other array.
SPACES HANDBOOKS EQUIPMENT MAKERS GROUPS PROJECT S ABOUT
Solution
A stacked sequence allowed me to force the order of execution. This way, I am only dealing with full
arrays of data. A sequence would not be needed if both arrays were initialized before the recording was
done. A simple for loop with auto-indexing tunnels sums the elements of the array and outputs the
results as one array.
audio-loop-two-waves-combining.vi
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 50/57
1/30/2017 myRIO | Tufts Maker Network
This sums each element of the two samples and stores them in another array.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 51/57
1/30/2017 myRIO | Tufts Maker Network
This is the final front panel control interface for the loop
terminal.
0:00 / 5:37
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 52/57
1/30/2017 myRIO | Tufts Maker Network
Solution
Now that the user is specifying the time to record, some simple calculations provide the program with
how many array elements are needed. This is used when recording, playing, and clearing.
SPACES
The stop HANDBOOKS
button has been replaced with aEQUIPMENT
loop counter. Also, MAKERS
notice the numGROUPS PROJECT
elements indicator S
which states how
ABOUT
many elements there are in the array.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 53/57
1/30/2017 myRIO | Tufts Maker Network
This loop uses the number of elements to clear the entire array
whenever the button is pressed.
The stop button has been replaced with a loop counter. Also, notice the num elements indicator which states how
many elements there are in the array. Also, the signal has been multiplied by 5 to increase volume and plays out
both audio channels.
Solution
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 54/57
1/30/2017 myRIO | Tufts Maker Network
Another for loop with auto-indexing tunnels allows for adding of recorded data to previous data. The
programs goes through the old array then creates a new array called the same thing, essentially
overwriting the old array. A flat sequence is used to ensure the correct order of execution. The entire
thing has been surrounded by another while loop to allow for as many sounds as the user wants.
Also, the player will run simultaneously with the recorder so the user can hear what they are recording
over.
audio-loop-infinite-autoloop.vi
The for loop will overwrite the old array with the sum of the old array and the new array.
The new audio player will run while the record loop runs so the user can hear what they are recording over.
Going Further
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 55/57
1/30/2017 myRIO | Tufts Maker Network
Visit Dr. E's Challenges to upload your own audio loop solutions, and see how
others approached this project.
Here are some other cool project ideas that use the same basic principles as
the audio loop station.
This webpage is able to connect to a networked myRIO via a WebSocket. Commands and information
can be transmitted
SPACES back and forth, allowing
HANDBOOKS interaction with
EQUIPMENT a myRIO remotely
MAKERS GROUPSoverPROJECT
a wireless S ABOUT
connection.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 56/57
1/30/2017 myRIO | Tufts Maker Network
websocket.zip
you. There is also a special read and write VI that has been created to make the WebSocket interface
more intuitive. Normally if you wire a read then a write the program will wait for a read before it writes.
However, this VIs will check for a read and a write at the same time to allow for constant reading or
writing without relying on a predetermined order.
https://maker.tufts.edu/handbooks/myrio#project3smartnightlight 57/57