From d9d92203ea349d5eb44c0edc5565d827322caabe Mon Sep 17 00:00:00 2001 From: Jorawar Singh Date: Sun, 16 Jul 2017 22:17:43 +0530 Subject: Toolbox merge, RPI demos and structured demos --- tests/unit_tests/test_RPi/wait_and_blink.sci | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/unit_tests/test_RPi/wait_and_blink.sci (limited to 'tests/unit_tests/test_RPi/wait_and_blink.sci') 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 00000000..099feaa0 --- /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 -- cgit From 38f1fb926d82f9144a5e9a28595d2d21dcc08f8e Mon Sep 17 00:00:00 2001 From: Jorawar Singh Date: Thu, 20 Jul 2017 03:56:03 +0530 Subject: Added demo and lcd128x64 fixed --- tests/unit_tests/test_RPi/wait_and_blink.sci | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/unit_tests/test_RPi/wait_and_blink.sci') diff --git a/tests/unit_tests/test_RPi/wait_and_blink.sci b/tests/unit_tests/test_RPi/wait_and_blink.sci index 099feaa0..7f77ad0f 100644 --- a/tests/unit_tests/test_RPi/wait_and_blink.sci +++ b/tests/unit_tests/test_RPi/wait_and_blink.sci @@ -1,3 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + function wait_and_blink() raspi("10.42.0.144","panda","pi"); // setup connection to Pi RPI_pinNumbering("wiringpi"); // initialize pin numbering -- cgit