Selling the firmware and kit as a product

Is it possible to sell my Photon code with mobile app as a product.
Instead of trying to develop a fully developed product, I was thinking what if I sell the code and give the parts list to assemble the product to start off with.
Then if that works out, offer to sell the circuit board with parts. Then use the proceeds to create a full pledge product.

If this can be done, how do you protect your Photon code with a license? What would be the best way to distribute the code?

Thanks

I’d reckon you could do that, although that’d raise the bar for purchasing. The folks who are savvy enough to make the product work when only the code’s provided, are mostly also the folks who are capable to program it themselves. It all depends on the price to determine if people find it worthwhile enough to ‘just’ buy code.

Hmm, you could just provide them with the binary to flash. That way they can’t see your code, but it wouldn’t prevent them from redistributing it if they really wanted to. You could create a webpage from which they could trigger a firmware flash to their device?