diff options
Diffstat (limited to '2.3-1/src/c/scilab-arduino')
15 files changed, 317 insertions, 3 deletions
diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c b/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c new file mode 100644 index 00000000..ebfad618 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + +#include "cmd_analog_in.h" + +uint16 u8cmd_analog_ins(uint8 board_no, uint8 pin) +{ + return((uint16)analogRead(pin)); +} + diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c b/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c new file mode 100644 index 00000000..94d51f6f --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + +#include "cmd_analog_out.h" + +uint8 u8cmd_analog_outs(uint8 board_no, uint8 pin, uint8 value) +{ + analogWrite(pin,value); + return 0; +} + diff --git a/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c b/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c new file mode 100644 index 00000000..1d0036a4 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + +#include "cmd_digital_in.h" + +uint8 u8cmd_digital_ins(uint8 board_no, uint8 pin) +{ + return((uint8)digitalRead(pin)); +} + diff --git a/2.3-1/src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c b/2.3-1/src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c index 0d43b867..09dffd62 100644 --- a/2.3-1/src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c +++ b/2.3-1/src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c @@ -12,8 +12,9 @@ #include "cmd_digital_out.h" -void u8cmd_digital_outs(uint8 board_no, uint8 pin, uint8 value) +uint8 u8cmd_digital_outs(uint8 board_no, uint8 pin, uint8 value) { digitalWrite(pin,value); + return 0; } diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h new file mode 100644 index 00000000..5361fe80 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __CMD_ANALOG_IN_H__ +#define __CMD_ANALOG_IN_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16 u8cmd_analog_ins(uint8 board_no, uint8 pin); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_DIGITAL_IN_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h new file mode 100644 index 00000000..d7fca535 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __CMD_ANALOG_OUT_H__ +#define __CMD_ANALOG_OUT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8cmd_analog_outs(uint8 board_no, uint8 pin, uint8 value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_ANALOG_OUT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h new file mode 100644 index 00000000..96fd24bb --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __CMD_DIGITAL_IN_H__ +#define __CMD_DIGITAL_IN_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8cmd_digital_ins(uint8 board_no, uint8 pin); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_DIGITAL_IN_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h index 2d8b0b4a..ee459d18 100644 --- a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h @@ -20,7 +20,7 @@ extern "C" { #endif -void u8cmd_digital_ins(uint8 board_no, uint8 pin, uint8 value); +uint8 u8cmd_digital_outs(uint8 board_no, uint8 pin, uint8 value); #ifdef __cplusplus } /* extern "C" */ diff --git a/2.3-1/src/c/scilab-arduino/includes/sleep.h b/2.3-1/src/c/scilab-arduino/includes/sleep.h new file mode 100644 index 00000000..2e2940a3 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/sleep.h @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __SLEEP_H__ +#define __SLEEP_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u16sleeps(uint16 delay_ms); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_DIGITAL_OUT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in.h new file mode 100644 index 00000000..0df8fcbf --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in.h @@ -0,0 +1,30 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __INT_CMD_ANALOG_IN_H__ +#define __INT_CMD_ANALOG_IN_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_analog_inu160(in1,in2) u8cmd_analog_ins((uint8)in1,\ + (uint8)in2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_ANALOG_IN_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h new file mode 100644 index 00000000..d6b16f81 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h @@ -0,0 +1,30 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __INT_CMD_ANALOG_OUT_H__ +#define __INT_CMD_ANALOG_OUT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0cmd_digital_outu80(in1,in2,in3) u8cmd_analog_outs((uint8)in1,\ + (uint8)in2,(uint8)in3) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_DIGITAL_OUT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_in.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_in.h new file mode 100644 index 00000000..04b773c6 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_in.h @@ -0,0 +1,30 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __INT_CMD_DIGITAL_IN_H__ +#define __INT_CMD_DIGITAL_IN_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_digital_inu80(in1,in2) u8cmd_digital_ins((uint8)in1,\ + (uint8)in2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_DIGITAL_IN_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_out.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_out.h index 7e630e32..a3d1eabd 100644 --- a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_out.h +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_digital_out.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define d0d0d0cmd_digital_outd0(in1,in2,in3) u8cmd_digital_outs((uint8)in1,\ +#define d0d0d0cmd_digital_outu80(in1,in2,in3) u8cmd_digital_outs((uint8)in1,\ (uint8)in2,(uint8)in3) #ifdef __cplusplus diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_sleep.h b/2.3-1/src/c/scilab-arduino/interfaces/int_sleep.h new file mode 100644 index 00000000..8e2d0824 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_sleep.h @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + + +#ifndef __INT_SLEEP_H__ +#define __INT_sLEEP_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0sleepu80(in1) u16sleeps((uint16)in1) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_SLEEP_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c b/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c new file mode 100644 index 00000000..14da0ba9 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 + * + */ + +#include "sleep.h" + +uint8 u16sleeps(uint16 delay_ms) +{ + delay(delay_ms); + return 0; +} + |