diff options
author | Abhinav Dronamraju | 2017-07-17 22:03:40 +0530 |
---|---|---|
committer | Abhinav Dronamraju | 2017-07-17 22:03:40 +0530 |
commit | 70ec68c70d86edcf17f3ab5aa74a4598d48c0fc8 (patch) | |
tree | 98467a7fccd87beca85bbd5b75123a96817356d3 /tests | |
parent | 574ddf08c208a2d1b8c27fe29525f631816c32d5 (diff) | |
parent | 51a8cdb8a204ff4327e2e734e78c2447a9bdd865 (diff) | |
download | Scilab2C_fossee_old-70ec68c70d86edcf17f3ab5aa74a4598d48c0fc8.tar.gz Scilab2C_fossee_old-70ec68c70d86edcf17f3ab5aa74a4598d48c0fc8.tar.bz2 Scilab2C_fossee_old-70ec68c70d86edcf17f3ab5aa74a4598d48c0fc8.zip |
Merged fossee master
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_tests/test_RPi/wait_and_blink.sci | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit_tests/test_RPi/wait_and_blink.sci b/tests/unit_tests/test_RPi/wait_and_blink.sci new file mode 100644 index 0000000..099feaa --- /dev/null +++ b/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 |