I am currently working on machine thats gonna use arduino and i dont want to reveal that code to the person whom i am gonna sell it. I just want to add password protect to the code. Is that possible?
That's possible. Just create the code.
Yes, possible.
You don't need a password. because after compiling your board doesn't contain arduino code, but only the binary firmware.
There is no way to restore source code from the binary file after compilation.
This forum gets this question a few times a year. The answer(s) (above, and throughout the forum) would be a good entry if an "f.a.q." existed.
All well and good if they read the stuff.
See how many times the newbies post first time with code not in code tags as an example.
Seems instructions are for everybody else, not them.
How to do that ?
Which board? For AVR based boards, you set the lock bits; you need a programmer and study the datasheet. I do not know if it can be done for other boards.
You will have to study some more on legal stuff around open source software. If the person that you develop this for wants the source code, you need to provide it (to my knowledge, I'm not a legal expert).
What do you think is the point of protecting it? Generally it's easier to write new code than to reverse engineer existing code from a micro-controller.
Don't forget this is a hobby forum, are you sure you want to take advice on a commercial project from people you don't know in a hobby forum?
Not quite if one wants to make easy bucks.
I did spend about two weeks developping code for a friend (free of charge) and programmed a couple of Nanos with the code for him to be put in the hardware; they were read protected on my friend's request.
Potential customer asked for one for testing and within a day he had a question why the customer could not read out the code from the microcontroller. His question to the customer was why the customer would be interested to do so? And after that it went silent ![]()