A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Arduino Automated X-Mas Lighting - Stikked
From TEKNO, 6 Years ago, written in C++.
Embed
  1. //Made by TEKNO
  2. const int sensor = A0; //The photoresistor is connected to A0.
  3. const int relay = 8; //The relay is connected to digital pin 8.
  4.  
  5. void setup() {
  6.   Serial.begin(9600);
  7.   pinMode(sensor,INPUT);
  8.   pinMode(relay,OUTPUT);
  9.   digitalWrite(relay,HIGH); //My relay is reversed so HIGH = Off , LOW = On. You should connect your extension cord's one cable (neutral for example) to the COM port of your relay and then put a cable between relay's NO port and the place where you have unplugged the neutral cable from.
  10. }
  11.  
  12. void loop() {
  13.  Serial.println("Sensor reads: " + String(analogRead(sensor)));
  14.  if(analogRead(sensor) > 100) { //Change 100 to your ideal number which you can get by testing.
  15.   digitalWrite(relay,HIGH);
  16.  } else {
  17.   digitalWrite(relay,LOW);
  18.  }
  19.  delay(500);
  20. }
  21. //Made by TEKNO