@@ -99,6 +99,10 @@ Returns a 8 bits integer giving the battery level.
9999
100100Returns a floating value of the battery voltage (in Volt, I guess?).
101101
102+ > These functions are missing from the hardware!
103+ > See [ this issue on NumWorks/epsilon's repository] ( https://github.com/numworks/epsilon/issues/2326 )
104+ > TODO: [ I could try to implement them myself, by SVC calls] ( https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5 )
105+
102106### Display
103107
104108#### ❌ ` void Eadk.display_draw_string(const char* text, uint16_t x, uint16_t y, bool large_font, uint16_t text_color, uint16_t background_color) `
@@ -107,23 +111,27 @@ TODO: I still haven't been able to define this one correctly, due to the `char*
107111
108112### Timing
109113
110- #### ✅? ` void Eadk.timing_usleep(uint32_t us) `
114+ #### ✅ ` void Eadk.timing_usleep(uint32_t us) `
111115
112116Sleep for ` us ` micro-seconds
113117
114- #### ✅? ` void Eadk.timing_msleep(uint32_t ms) `
118+ #### ✅ ` void Eadk.timing_msleep(uint32_t ms) `
115119
116120Sleep for ` ms ` micro-seconds
117121
118- #### ❌ ` uint64_t Eadk.timing_millis() `
122+ #### ✅ ` uint64_t Eadk.timing_millis() `
119123
120124Time since boot of the machine? Not clear. FIXME:
121125
122126### Miscellanious
123127
124128#### ❌ ` bool Eadk.usb_is_plugged() `
125129
126- Indicates whether the USB is plugging.
130+ Indicates whether the USB is plugged.
131+
132+ > This function is missing from the hardware!
133+ > See [ this issue on NumWorks/epsilon's repository] ( https://github.com/numworks/epsilon/issues/2326 )
134+ > TODO: [ I could try to implement it myself, by SVC calls] ( https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5 )
127135
128136#### ✅? ` uint32_t Eadk.random() `
129137
@@ -141,35 +149,31 @@ The functions already present should give a good direction to follow!
141149
142150The example below runs now correctly and showcases a decreasing then increasing brightness, with small pauses between every change:
143151
152+ For a more complete and length example, see [ ` src/test.js ` ] ( src/test.js ) .
153+
144154``` javascript
145155// Save this to `javascript.py` on your NumWorks, and run it with
146156// the "JS interpreter" NumWorks application!
147157
148- function msleep (s ) {
149- for (let j = 1 ; j <= s; j++ ) {
150- // Just a comment here
151- }
152- }
153-
154158console .log (" Hello world from JavaScript!" );
155159console .log (" Testing Eadk functions:" );
156- msleep (5000 );
160+ Eadk . timing_msleep (5000 );
157161
158162const brightness = Eadk .backlight_brightness ();
159163console .log (" Eadk.backlight_brightness() =" , Eadk .backlight_brightness ());
160- msleep (2000 );
164+ Eadk . timing_msleep (2000 );
161165
162166for (let dwarf = 1 ; dwarf <= 13 ; dwarf++ ) {
163167 for (let b = brightness; b >= 0 ; b= b- 16 ) {
164168 Eadk .set_backlight_brightness (b);
165169 console .log (" Eadk.backlight_brightness() =" , Eadk .backlight_brightness ());
166- msleep (50 );
170+ Eadk . timing_msleep (50 );
167171 }
168172
169173 for (let b = 0 ; b <= brightness; b= b+ 16 ) {
170174 Eadk .set_backlight_brightness (b);
171175 console .log (" Eadk.backlight_brightness() =" , Eadk .backlight_brightness ());
172- msleep (50 );
176+ Eadk . timing_msleep (50 );
173177 }
174178}
175179```
0 commit comments