-
Notifications
You must be signed in to change notification settings - Fork 10
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
Kickstarter #13
Comments
Hey, @dpkano! If you are using the app to generate the code, perhaps the best idea would be to use the app to upload the code. Currently the SDK does not support the Kickstarter Pixel Kit but even if it does, it will probably not focus on uploading code generated from Kano Code App. Not because we don't want it to happen but because right now the idea is to have an independent API to draw on screen and get button events. Your code would probably look more like this example of how to stream a frame to the Pixel Kit. Having said that, there is an "RPC" method to upload animations to the Retail Pixel Kit and code (like yours) to the Kickstarter Pixel Kit. Those methods are not yet implemented by this SDK for technical reasons: They require way more configuration and a more complex approach then just sending a "frame" to the screen. If you are up to interacting with the Kickstarter Pixel Kit with the // If your script is running from the root folder
const PixelKit = require('./src/retailpixelkit.js');
// First you need to find your Pixel Kit serial port. That changes depending of your OS.
let pk = new PixelKit({
path: 'YOUR PIXEL KIT SERIAL PORT PATH HERE',
});
// Connect to your Pixel Kit, interact with it (check the examples) and handle errors
pk.connect()
.then((connectedPixelKit) => {
// Do stuff with your Pixel Kit here!
})
.catch((err) => console.log(err)) Let me know if you give it a try and what kind of errors and ideas you get! |
Nice. I'll give it a try. Thanks, |
Oh nice! Well spotted!!!! 🎉 🥇
Yes, in case you want to connect via WebSocket to your Pixel Kit you should definitely change that port.
Yes, they both implement an RPC protocol. If you want more detail on how that works, this file is the implementation we are using. If you send a JSON on a very specific format to the Pixel Kit (over WebSocket or USB Serial) it will respond with another JSON. That is also true for hardware events like button and joystick presses. Although both Pixel Kits are RPC servers, they have a few "methods" that are different. Unfortunately I don't have in hands a full specification of this API but if you sniff the packets Kano Code App sends you are definitely going to find them all! |
Quick update:
I did not have time to fix these issues... maybe on the weekend... :( |
Hey, @dpkano ! Thanks a lot for the update: You are a star 🌟! The This could be that the previous WebSocket connection wasn't closed properly so the Pixel Kit rejects any new connection before the previous one is closed. I have been fiddling around with WebSockets for a while now and I still don't have a good answer on how to gracefully close it but I hope one day we'll find it. Now about the I'm not sure how familiar you are with There is a list of things that could be wrong and perhaps it's worth to give a look at Installing SerialPort from their official documentation. It might be a |
Hi,
I'm trying to send some javascript code to the kickstarter pixel kit.
Ideally I'd like to send code like this:
When I export the "app" from the desktop application I get a .kcode file which is a json file. In this file I can see ".code.snapshot.javascript". If I change that content and import again nothing works... Is there a way I can auto generate the block part from the javascript I just generated? Or simply just push the javascript code?
Thanks,
Daniel
The text was updated successfully, but these errors were encountered: