Loading modules from SD Card #3870
Replies: 1 comment
-
Posted at 2014-06-25 by @gfwilliams Which version of Espruino are you using? the most recent one? Posted at 2014-06-25 by @gfwilliams By the way, you know that if you're using the Web IDE it'll load modules automatically without needing the SD card? Posted at 2014-06-25 by Uhv I have the latest version of Espruino - 1v65. Yes, I know this. But I haven't always an internet connection. And I'd like to save Espruino site modules to SD and to have they on hand anytime. Moreover it's comfortable to call own subroutines, that you use often, from module, and you needn't insert they manually every time in your new project. Posted at 2014-06-25 by @gfwilliams What filename/module name did you use? I just tried the following and it worked fine: In
And in Espruino's console:
Posted at 2014-06-25 by Uhv Posted at 2014-06-25 by @gfwilliams The problem is that you haven't actually written a proper module. Try:
Posted at 2014-06-25 by Uhv Really. It was a reason. Now all works properly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-06-25 by Uhv
Hi.
My board is a HYSTM32_24_ve. When I try to load a my own module saved in SD, Espruino Web IDE tells "Module xxx not found". What can be a reason of this situation?
When I look the SD by "require('fs').readdir()", the Espruino shows me its correct contents.
When I look the directory 'node_modules' by "require('fs').readdir('node_modules')", it shows me the file 'xxx.js', that I need.
But when I try type a "require('xxxx')", it returns me "Module xxx not found".
Beta Was this translation helpful? Give feedback.
All reactions