diff options
Diffstat (limited to '2.3-1/macros/Hardware/RasberryPi/lcd')
14 files changed, 534 insertions, 0 deletions
diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci new file mode 100755 index 00000000..905cca84 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci @@ -0,0 +1,44 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) +// Function to redefine a user-definable character +// +// Calling Sequence +// RPI_lcdCharDef(fd,index,data) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// index: which character to redefine (0 to 7) +// d0-d7: integers from 0 to 255 erpresenting the elements of the array to form the character +// +// Description +// This function re-define one of the 8 user-definable characters in the display. +// +// The data array is 8 bytes which represent the character from the top-line to the bottom line. Note that the characters are actually 5×8, so only the lower 5 bits are used. +// +// Examples +// RPI_lcdCharDef(13,0,0,0,0,31,31,31,31,0) +// See also +// RPI_lcdCursorBlink, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCD#10#"+string(fd)+"#"+string(index)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci new file mode 100755 index 00000000..6da7212d --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci @@ -0,0 +1,40 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdClear(fd) +// Function to clear the lcd screen +// +// Calling Sequence +// RPI_lcdClear(fd) +// +// Parameters +// fd: file-descriptor obtained using RPI_lcdInit function +// +// Description +// This function clears the lcd screen. +// +// Examples +// RPI_lcdClear(13) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCl#1#"+string(fd)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci new file mode 100755 index 00000000..98c54712 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCursor(fd,state) +// Function to turn cursor on/off +// +// Calling Sequence +// RPI_lcdCursor(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function sets the visibility of cursor. +// +// Examples +// RPI_lcdCursor(13,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCu#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci new file mode 100755 index 00000000..b16ebc50 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdCursorBlink(fd,state) +// Function to turn cursor blinking on/off +// +// Calling Sequence +// RPI_lcdCursorBlink(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function sets the blinking of cursor. +// +// Examples +// RPI_lcdCursorBlink(13,1) +// See also +// RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lCB#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci new file mode 100755 index 00000000..de50af64 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdDisplay(fd,state) +// Function to turn display on/off +// +// Calling Sequence +// RPI_lcdDisplay(fd,state) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// state: 0 (for off) or 1 (for on) +// +// Description +// This function turns the display 'on' or 'off'. +// +// Examples +// RPI_lcdDisplay(13,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lDs#2#"+string(fd)+"#"+string(state)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci new file mode 100755 index 00000000..0c4507f1 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci @@ -0,0 +1,40 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdHome(fd) +// Function to send cursor back to the starting point (home) +// +// Calling Sequence +// RPI_lcdHome(fd) +// +// Parameters +// fd: file-descriptor obtained using RPI_lcdInit function +// +// Description +// This function sends the cursor to the top left (row=0,col=0) position on the lcd screen. +// +// Examples +// RPI_lcdHome(13) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lHo#1#"+string(fd)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci new file mode 100755 index 00000000..c5ddb1e5 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci @@ -0,0 +1,54 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function out=RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) +// Function to initialize lcd +// +// Calling Sequence +// RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) +// +// Parameters +// rows: numer of rows in lcd +// cols: numer of colums in lcd +// bits: number of bits wide on the interface (4 or 8) +// rs : pin number of display RS +// strb: pin number of strobe (E) +// d0 : pin number of data pin 1 +// d1 : pin number of data pin 2 +// d2 : pin number of data pin 3 +// d3 : pin number of data pin 4 +// d4 : pin number of data pin 5 +// d5 : pin number of data pin 6 +// d6 : pin number of data pin 7 +// d7 : pin number of data pin 8 +// +// Description +// This function initalizes an lcd display attaced to the Raspberry pi. The return value is the file-descriptor to be used for all subsequent calls to the lcd library when dealing with that LCD, or -1 to indicate a fault. (Usually incorrect parameters) +// +// The numberin sequence to be followed as initiated using RPI_pinNumbering +// +// Examples +// fd=RPI_lcdInit (2,16,8,11,10,0,1,2,3,4,5,6,7) ; +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand, RPI_pinNumbering +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lIn#13#"+string(rows)+"#"+string(cols)+"#"+string(bits)+"#"+string(rs)+"#"+string(strb)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#"; + if getos()=="Linux" then + out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos()=="Windows" then + [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci new file mode 100755 index 00000000..0f978324 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci @@ -0,0 +1,42 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPosition(fd,col,row) +// Function to move the cursor +// +// Calling Sequence +// RPI_lcdPosition(fd,col,row) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// col: column number to go to +// row: row number to go to +// +// Description +// This function set the position of the cursor for subsequent text entry. col=0 is the left-most edge any row=0 is the top line. +// +// Examples +// RPI_lcdPosition(13,0,1) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPo#3#"+string(fd)+"#"+string(col)+"#"+string(row)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci new file mode 100755 index 00000000..833bf44a --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPrintf(fd,String) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPrintf(fd,String) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// String: string to print on the screen +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPrintf(13,'We live in the shadows to serve the light.') +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPf#2#"+string(fd)+"#"+String+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci new file mode 100755 index 00000000..337691d8 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPutchar(fd,character) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPutchar(fd,charcter) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// charcter: integer, 0 to 255, character to print +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPutchar(13,200) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPc#2#"+string(fd)+"#"+string(character)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci new file mode 100755 index 00000000..8584309d --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci @@ -0,0 +1,42 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdPuts(fd,character) +// Function to print on the lcd screen +// +// Calling Sequence +// RPI_lcdPuts(fd,character) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// character: character to print +// +// Description +// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands. +// +// Examples +// RPI_lcdPuts(13,'K') +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdSendCommand +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lPu#2#"+string(fd)+"#"+string(character)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction + diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci new file mode 100755 index 00000000..db677bef --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci @@ -0,0 +1,41 @@ +// 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 +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function RPI_lcdSendCommand(fd,command) +// Function to send command to lcd +// +// Calling Sequence +// RPI_lcdSendCommand(fd,command) +// +// Parameters +// fd : file-descriptor obtained using RPI_lcdInit function +// command: A command, binary, to submit to the LCD. +// +// Description +// This function sends any arbitrary command to the LCD. +// +// Examples +// RPI_lcdSendCommand(13,00) +// See also +// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts +// +// Authors +// Jorawar Singh +// +// Bibliography +// http://wiringpi.com/reference/ + + commande="lSC#2#"+string(fd)+"#"+string(command)+"#"; + if getos=="Linux" then + unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + elseif getos=="Windows" then + RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()"""); + end +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/buildmacros.sce b/2.3-1/macros/Hardware/RasberryPi/lcd/buildmacros.sce new file mode 100755 index 00000000..7d533f7b --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/buildmacros.sce @@ -0,0 +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 + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/names b/2.3-1/macros/Hardware/RasberryPi/lcd/names new file mode 100755 index 00000000..8f87ff8b --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/names @@ -0,0 +1,12 @@ +RPI_lcdCharDef +RPI_lcdClear +RPI_lcdCursor +RPI_lcdCursorBlink +RPI_lcdDisplay +RPI_lcdHome +RPI_lcdInit +RPI_lcdPosition +RPI_lcdPrintf +RPI_lcdPutchar +RPI_lcdPuts +RPI_lcdSendCommand |