You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-24Lines changed: 11 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
An experimental project to determine whether a full-featured scripting language can be used on larger-memory Arduino boards to control hardware. At the moment only the Giga board with Arduino Display Shield is supported, but future support for Portenta H7 (with USB-C display) may be possible.
6
6
7
-
The [Lox language](https://www.craftinginterpreters.com/) was chosen because of the availability of a ready-made implementation in C ([clox](https://github.com/munificent/craftinginterpreters/tree/master/c)) which is a compact and very quick JIT-compiled interpreter. It is also easy to extend with additional Lox functions, which are mapped to native C/C++ ones defined in the sketch. The construction of the interpreter is described in detail in the book "Crafting Interpreters", however reading the book is not necessarily a prerequisite for using the language or even extending it with new functions.
7
+
The [Lox language](https://www.craftinginterpreters.com/appendix-i.html) was chosen because of the availability of a ready-made implementation in C ([clox](https://github.com/munificent/craftinginterpreters/tree/master/c)) which is a compact and very quick JIT-compiled interpreter. It is also easy to extend with additional Lox functions, which are mapped to native C/C++ ones defined in the sketch. The construction of the interpreter is described in detail in the book "Crafting Interpreters", however reading the book is not necessarily a prerequisite for using the language or even extending it with new functions.
8
8
9
9
## Getting Started
10
10
@@ -13,12 +13,13 @@ The number of supported graphics functions (and other functions from [this page]
13
13
Flashing and booting the Giga results in a REPL in the Serial Monitor, enter line(s) of Lox code at `> ` (start) and `. ` (continuation) prompts, and press Enter on a blank line to execute. Error messages are reported in the REPL, and the blue LED turns on for the duration of executing the code fragment just entered. To pulse the blue LED for ten seconds use the following Lox code in the interpreter:
14
14
15
15
```javascript
16
-
pinMode(88, "OUTPUT");
16
+
var led =88;
17
+
pinMode(led, "OUTPUT");
17
18
for (var i =1; i <=10; i = i +1) {
18
19
delay(500);
19
-
digitalWrite(88, false);
20
+
digitalWrite(led, false);
20
21
delay(500);
21
-
digitalWrite(88, true);
22
+
digitalWrite(led, true);
22
23
}
23
24
```
24
25
@@ -79,6 +80,7 @@ In the style of the book "Crafting Interpreters" by Bob Nystrom, which describes
0 commit comments