-
• #2
It looks to me like someone didn't test all the modules they uploaded to espruino.com :) Just a second, I'll make some fixes - what you're doing seems fine.
-
• #3
Actually I was being unfair. Espruino changed recently so it errors for undefined variables - this would have worked fine previously, but it had some code left over from being copy/pasted from the MCP20S17 that would make it fail now.
If you try now I've changed it and it should work (you may have to shut down the IDE and restart it, as it might cache the modules).
-
• #5
... and the next question, of course...:
can I have the modul extension for MCP23S17 permanently on my PICO - that is without the WEB IDE? Currently I use for my js code always the function E.setBootCode(... .... ...
); and it works fine instandaloneĀ“. Should I separately download and add the
http://www.espruino.com/modules/MCP23S17.jsĀ“ too?
Thanks! -
• #6
No, that's fine - once it's written into flash with
E.setBootCode
(assuming you are using the IDE to do it?) everything will be stored on the Pico, including the module -
• #7
@Gordon thanks for the answer. No, I use an external text editor and I copy (frequently) the whole E.setBootCode (...) with ctrl+C/V to the left side of WEB IDE. In this way the download of external moduls are missing. Is there the possibility to download separately a package?lib?include?etc? to the moduls e.g. to MCP23S17 - also without the rigth side of WEB IDE?
Thanks! -
• #8
Well, you can:
- Just use the Web IDE normally and set
save on send
in the options, which wraps everything in setBootCode for you automatically. That'd be the sensible thing to do, but maybe you have other reasons :) - Use the
espruino
NPM package (https://www.npmjs.com/package/espruino) on the command-line. You can make this write code to Espruino, or can get it to write the code it would have written to Espruino to a file, which might be what you want? - Manually download modules from http://www.espruino.com/modules/ and try and put them in manually with
Modules.addCached
(insideE.setBootcode
)), but that just seems a bit crazy to be honest :)
- Just use the Web IDE normally and set
-
• #10
Can you please give me a solution, how can I control the LED in this example (see the attached picture)? PICO can now see the MCP23S17 (see console.log() on the IDE picture), but I cannot control the LED (on/off) with port.A0.* or other commands - what I'm doing wrong?
The cabel numbers on the picture:
1-white) to PICO B15 (MCP->14)
2-green) to PICO B14 (MCP->13)
3-yellow) to PICO B13 (MCP->12)
4-red) to PICO A8 (MCP->18)
5-black) direct to USB-
6-red) direct to USB+
Many thanks in advance!
2 Attachments
-
• #11
Have you set the pin mode to output?
Also, to check it's working, you could also try reading back the values with
port.readPort()
and see if you can get them to change by connecting pins to 3.3v or 0v? -
• #12
write/read was ok and readPort returns with 4801 (see att.), but no LED activitate was visible...
...but the LED lights up when I shortly test it at MCP-19 or MCP-20
1 Attachment
-
• #13
Not sure I understand? what's MCP-19/MCP-20?
What happens to the value from readPort if you connect up other pins of the MCP23S17 to 0 or 3.3v?
Hi All, my problem is in short:
Thank you for your answer!
2 Attachments