Skip to content
Snippets Groups Projects
Commit 35901e97 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Add an arduino directory

parent 0a4f0ac5
No related branches found
No related tags found
No related merge requests found
Showing
with 171 additions and 1 deletion
......@@ -88,6 +88,14 @@ opam : $(WWW)/pool/$(PACKNAME).tgz
cd .. ; opam-admin check && opam-admin make -g \
) || echo "*** I won't make an opam package\n*** until you commit something!"
verimag:
echo "su synchron + opam update + opam upgrade "
#
# nb : pour installer la derniere version dans /usr/local/tools/lustre/v6
# il suffit de faire
# make opam + su synchron + opam update + opam upgrade
###############################
# tags
......
OASISFormat: 0.4
Name: lustre-v6
Version: 1.666
Version: 1.667
Synopsis: The Lustre V6 Verimag compiler
Description: This package contains:
(1) lus2lic: the (current) name of the compiler (and interpreter via -exec).
......
v4:
lus2ec blink.lus blink
ec2c blink.ec
mv blink.h blink_loop/
mv blink.c blink_loop/blink.cpp
v6:
lus2lic -2c blink.lus -n blink
mv blink_blink.h blink_loop_v6/
mv blink_blink.c blink_loop_v6/blink_blink.cpp
clean:
rm -f *.c *.h *.ec *.sh */*.cpp */*.h
node blink (dummy:bool) returns (led1,led2:bool);
let
led1 = false -> not pre(led1);
led2 = not led1;
tel
\ No newline at end of file
#include "blink.h"
struct blink_ctx* ctxt = blink_new_ctx(NULL);
byte led1 = 13;
byte led2 = 12;
/*****************
* Main procedures
*/
void setup() {
Serial.begin(9600);
blink_reset(ctxt);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
}
void loop() {
static int step_nb = 0;
// Set inputs
// no inputs
delay(100); // wait for a little time
// Do a step
blink_step(ctxt);
step_nb++;
}
/*******************
* Output procedures
*/
void blink_O_led1(void* cdata, _boolean _V) {
digitalWrite(led1, _V*HIGH);
}
void blink_O_led2(void* cdata, _boolean _V) {
digitalWrite(led2, _V*HIGH);
}
#include "blink_blink.h"
blink_blink_ctx_type* ctx = blink_blink_ctx_new_ctx();
byte PIN_led1 = 13;
byte PIN_led2 = 12;
void setup() {
Serial.begin(9600);
blink_blink_ctx_reset(ctx);
pinMode(PIN_led1, OUTPUT);
pinMode(PIN_led2, OUTPUT);
}
void loop() {
_boolean dummy;
_boolean led1;
_boolean led2;
// Set inputs
dummy=false;
// Do a step
blink_blink_step(dummy,&led1,&led2,ctx);
digitalWrite(PIN_led1, led1);
digitalWrite(PIN_led2, led2);
delay(1000); // wait for a little time
}
FILE=led
NODE=arduino_puzzle
v6: led.lus
lus2lic -2c $(FILE).lus -n $(NODE)
mv *.h $(FILE)_$(NODE)_loop/
mv $(FILE)_$(NODE).c $(FILE)_$(NODE)_loop/$(FILE)_$(NODE).cpp
%.simu:
luciole-rif lus2lic -exec -rif led.lus -n $*
%.arduino:
cp arduino_$*.lus arduino_puzzle.lus
make v6
%.no_sol:
lus2lic -ec -o no_sol.ec led.lus -n $*_has_no_solution
ecverif no_sol.ec -diag || cat msg
clean:
rm -f *.c *.h *.ec *.sh *.rif rdbg-session.ml *.gp *.log *.dro
rm led_arduino_puzzle_loop/led_arduino_puzzle.cpp
rm led_arduino_puzzle_loop/*.h
cd doc; make clean
v4:
lus2ec $(FILE).lus $(FILE)
ec2c $(FILE).ec
mv $(FILE).h $(FILE)_loop_v4/
mv $(FILE).c $(FILE)_loop_v4/$(FILE).cpp
make puzzle1.arduino
\ No newline at end of file
make puzzle2.arduino
\ No newline at end of file
make puzzle3.arduino
\ No newline at end of file
make puzzle4.arduino
\ No newline at end of file
make puzzle5.arduino
\ No newline at end of file
make puzzle6.arduino
\ No newline at end of file
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle6(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle1(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle2(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle3(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle4(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle5(pulse(red), pulse(blue));
tel
node arduino_puzzle(red,blue:bool) returns (led1,led2,led3,led4,led5:bool);
let
led1,led2,led3,led4,led5=puzzle6(pulse(red), pulse(blue));
tel
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment