MCP41010 Raspberry Pi Questions was wrongfully closed and migrated. The problem has nothing to do with the RPI and is 100% on-topic electronics question. This is mod abuse.
Raspberry Pi was mentioned right in the title, and then there was code shown that of course is specific to RPi.
Perhaps after careful reading it might be possible to find that there is a basic electronics problem in there, but that would be more work than is expected of the volunteers here. If your question really isn't about a Raspberry Pi or its code, then don't prominently feature them in the title and the question.