The document presents a framework for automatic code generation from formal specifications for wireless sensor network (WSN) protocols, primarily transitioning from high-level timed automata to low-level nesc implementations. It outlines the use of formal methods to ensure the reliability of these protocols while detailing a tool developed to automate this transformation process with specified rules and modeling restrictions. The approach is illustrated through a case study focused on humidity and temperature sensing applications in WSNs.