How can I create simple contracts and sign them in C or Arduino

I am in the creation of smart contracts for IoT, I can already obtain information from the contracts with an arduino or esp32. But now I want to create simple contracts and sign them on the arduino or esp32. Any help would be helpful, thank you very much

What do you mean by “signing contracts”?
Do you mean signing transactions that make application calls?

In that case, what is the purpose of signing?
How secure must the secret key be?
ESP32 and Arduino do not have a way to securely store secret keys (at least most of them don’t to my knowledge).
You can always store them in insecure memory, but then a reasonably good attacker can easily extract them.
Depending on your application, this may or may not be an issue.

Now, regarding signing transactions, you can look at what is doing.