Hi All, my problem is in short:
Thank you for your answer!
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.
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).
@Gordon Thanks for the fast answer, it seems to working now correctly! Thank you!
... 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 in standalone´.
Should I separately download and add thehttp://www.espruino.com/modules/MCP23S17.js´ too?
... .... ...
Should I separately download and add the
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
@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?
Well, you can:
save on send
@Gordon thanks for the info. I'll check all the three. You're right the first is the most convenient way. Thank you!
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!
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?
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
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?
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem