Replies: 1 comment
-
Hello, Writing to a pc file, I would not know, but communication between hub and pc has an example here Maybe there is a good start? Bert |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hopefully someone here can help since I've asked at 3 places with no answers but let's see. Since spike hubs use micro python and have a very limited number of modules to use, I was going to make two python code scripts, one which the hub would run off and the other one to do other things on my computer that the spike prime hub can't do because of its limited functions. They would communicate and send signals by the hub script writing messages onto a .txt file on my computer and the other script to then read it and do that command which the spike prime hub wouldn't be able to do.
E.g. If the colour red is detected:
write 'red' on to a .txt file on my computer
Another python script on my computer will then read that .txt file and then carry out the function of what to do when red is written in the .txt file.
I am not very experienced in coding and spike prime, however I couldn't find out how to make the spike prime hub write onto the .txt file in Pybricks using this code:
Any recommendations on how to do this or somehow make it possible for the hub to communicate with another python file that's got nothing to do with lego? Any help will help, thanks
Beta Was this translation helpful? Give feedback.
All reactions