Question

Can someone please explain to me these codes from MATLAB. Thank you 1) %right microswitch DOdata...

Can someone please explain to me these codes from MATLAB. Thank you

1) %right microswitch

DOdata = [ 0 0 0 0 0]

outputSingleScan(s,DOdata)

2)

% Servo Motor

addAnalogOutputChannel(servo,'myDAQ1','ao0','Voltage')

DOdata = [ 1 0 0 1 0]

outputSingleScan(s,DOdata);

while true

pause(0.5)

DOdata = [ 0 1 1 0 0]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

outputSingleScan(s,DOdata ) will output a single scan of data on one or more analog output channels.

For example :

You have to add one or more analog or digital output channels

s = daq.createSession('ni'); %This will create a session
addAnalogOutputChannel(s,'myDAQ1','ao0','Voltage') %This will add a analog device

outputSingleScan(s,DOdata) %This will output single scan on all connected output channels

Now both the codes are self explanatory with this info: , Let me know in comments if you could not get the logic

Add a comment
Know the answer?
Add Answer to:
Can someone please explain to me these codes from MATLAB. Thank you 1) %right microswitch DOdata...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT