summaryrefslogtreecommitdiff
path: root/2.3-1/tests/unit_tests
diff options
context:
space:
mode:
authorBrijeshcr2017-07-17 15:50:41 +0530
committerGitHub2017-07-17 15:50:41 +0530
commit966afe93dbda0568dc376534ac94704ebbfb0329 (patch)
treebf86fe87d6e029e78fded38edfa43eb0850f20cf /2.3-1/tests/unit_tests
parent2e35a1f26a7ec9e4466a5e0448f9a868aa801471 (diff)
parentdd6e5712f0df88fc23f51f542e2bbc019799a71e (diff)
downloadScilab2C-966afe93dbda0568dc376534ac94704ebbfb0329.tar.gz
Scilab2C-966afe93dbda0568dc376534ac94704ebbfb0329.tar.bz2
Scilab2C-966afe93dbda0568dc376534ac94704ebbfb0329.zip
Merge pull request #18 from jschandi/master
Toolbox merge, demos structured and RPI demos added
Diffstat (limited to '2.3-1/tests/unit_tests')
-rw-r--r--2.3-1/tests/unit_tests/test_RPi/wait_and_blink.sci16
1 files changed, 16 insertions, 0 deletions
diff --git a/2.3-1/tests/unit_tests/test_RPi/wait_and_blink.sci b/2.3-1/tests/unit_tests/test_RPi/wait_and_blink.sci
new file mode 100644
index 00000000..099feaa0
--- /dev/null
+++ b/2.3-1/tests/unit_tests/test_RPi/wait_and_blink.sci
@@ -0,0 +1,16 @@
+function wait_and_blink()
+ raspi("10.42.0.144","panda","pi"); // setup connection to Pi
+ RPI_pinNumbering("wiringpi"); // initialize pin numbering
+ RPI_pinMode(0,"out"); // set pin 0 as OUTPUT
+ RPI_pinMode(1,"in"); // set pin 1 as INPUT
+ RPI_waitForInterrupt(1,-1); // wait for Interrupt at pin 1,with no timeout.
+ for i=1:5 // interrupt recieved
+ RPI_digitalWrite(0,1); // set pin 0 voltage HIGH
+ RPI_delay(1000); // delay for 1 second
+ RPI_digitalWrite(0,0); // set pin 0 voltage LOW
+ RPI_delay(1000); // delay for 1 second
+ end
+ RPI_pinMode(0,"in"); // reset pin 0 to INPUT
+ disp("Demo completed successfully.")
+ raspi_close(); // close the opened connection
+endfunction