Added firmware stuff

Added some code for the logic circuits
New things added to logic