Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spi uses the device to disconnect #139

Closed
yueduz opened this issue Oct 28, 2021 · 0 comments
Closed

spi uses the device to disconnect #139

yueduz opened this issue Oct 28, 2021 · 0 comments

Comments

@yueduz
Copy link

yueduz commented Oct 28, 2021

Hi!
I want to use the spi device, I only need to receive data from the slave, and the host does not need to send data.

I use the following code:

            var s = new spi.SPI({ pinSCLK: 18, pinMISO: 19, pinMOSI: 23 });
            s.transfer(Buffer.from([0x00, 0x00]), (err, data) => {
                console.log(err);
                console.log(data);
            });

Always get the following result:

$ lowsync sync
Fetching file system listings...
Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
Synchronization complete |██████████████████████████████| 100%
PC => MC: +File index.js
? Would you like to show the output of the microcontroller? (Use the --monitor command line option to remove this prompt and enable/disable showing of the output after sync.) Yes
Restarting program...
Starting monitor...
--- User program's output: ---
*** The connection has been lost. We will retry connecting to the microcontroller. In the meantime, please check your connection ***
*** The connection to the microcontroller has been re-established ***
*** The connection has been lost. We will retry connecting to the microcontroller. In the meantime, please check your connection ***
*** The connection to the microcontroller has been re-established ***

thank you!

@yueduz yueduz closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant