Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract IOT {
- uint public temperature;
- address sensor;
- address led;
- event Instruction( address device, string instruction)
- function IOT (address _sensor, address LED ){
- sensor = _sensor;
- led = LED;
- }
- function updateTemp(uint temp){
- if(msg.sender != sensor) throw;
- temperature = temp;
- if (temperature > 60) {
- Instruction(led, "ON");
- {
- else Instruction (led,"OFF");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement