Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. contract IOT {
  2.  
  3. uint public temperature;
  4. address sensor;
  5. address led;
  6.  
  7. event Instruction( address device, string instruction)
  8.  
  9. function IOT (address _sensor, address LED ){
  10. sensor = _sensor;
  11. led = LED;
  12. }
  13.  
  14. function updateTemp(uint temp){
  15. if(msg.sender != sensor) throw;
  16. temperature = temp;
  17. if (temperature > 60) {
  18. Instruction(led, "ON");
  19. {
  20. else Instruction (led,"OFF");
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement