Κυριακή 26 Μαΐου 2013

PC BUSTERS ARDUINO WEB CONTROL OUTPUT

processing code

#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0, 177);

// Initialize the Ethernet server library
// with the IP address and port you want to use 
// (port 80 is default for HTTP):
EthernetServer server(80);

int LEDpin = 4;
String readString = String(30);
String state = String(3);

void setup()
{
  Serial.begin(9600);
  while (!Serial);
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

  //Sets the LEDpin as an output
  pinMode(LEDpin,OUTPUT);

  digitalWrite(LEDpin,LOW);
  state = "OFF";
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply

        if (readString.length() < 30) {
          readString.concat(c);
        }

        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          int LED = readString.indexOf("LED=");


          if (readString.substring(LED,LED+6) == "LED=ON") {
            digitalWrite(LEDpin,HIGH);
            delay(1000);
            digitalWrite(LEDpin,LOW);
            delay(100);
            digitalWrite(LEDpin,HIGH);
            state = "ON";
          }
          else if (readString.substring(LED,LED+7) == "LED=OFF") {
            digitalWrite(LEDpin,LOW);
            state = "OFF";
          } 
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.print("<b>LED CONTROL</b>");
          client.print("<br><br>");
          client.print("<br><br>");
          client.print("LED is ");
          client.print(state);
          client.print("<br><br>");
          client.print(bitRead(PORTD,4));//Reads bit 4 of register PORTD which contains the current state (high/low) of pin 4
          client.print("<br><br>");
          if (bitRead(PORTD,4)==1){
            client.print(" Pin 4 is High as fuck");
            client.print("<br><br>");
            Serial.println(state);
          }
          else
          {
            client.print("Pin 4 is DOWN");
            client.print("<br><br>");
            Serial.println(state);
          }

          if (state == "ON") {
            client.print("<body style=background-color:green>");
            client.println("<form method=get name=LED><input type=submit name=LED value=OFF>  <b>LED ON</b><form>");
            //client.println("<a href="./?LED=F">Turn Off<a>");
          }
          else {
            client.print("<body style=background-color:red>");
            client.println("<form method=get name=LED><input type=submit name=LED value=ON> <b>LED OFF</b><form>");
            //client.println("<a href="./?LED=ON">Turn On<a>");
          }
          client.print("<br><br>");
          client.print("<br><br>");
          client.print("<b>PC BUSTERS</b>   Web Control Led Project 2013");
          break;
        }

        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    readString = "";
    // close the connection:
    client.stop();
  }
}
Read more...

Τετάρτη 20 Φεβρουαρίου 2013

ΣΕΛΙΔΕΣ ΜΑΘΗΜΑΤΙΚΩΝ ΟΡΙΑ ΣΥΝΑΡΤΗΣΕΩΝ

ΜΑΘΗΜΑΤΙΚΑ ΚΑΤΕΥΘΥΝΣΗΣ  ΜΑΘΗΜΑΤΙΚΑ ΓΕΝ. ΠΑΙΔΕΙΑΣ  
ΜΙΓΑΔΙΚΟΙ
---
ΣΥΝΑΡΤΗΣΕΙΣ
---
ΟΡΙΑ
---
ΣΥΝΕΧΕΙΑ
    6. Ασκήσεις επανάληψης - όρια, συνέχεια
---
ΠΑΡΑΓΩΓΟΙ-ΜΕΡΟΣ 1ο
---
ΠΑΡΑΓΩΓΟΙ-ΜΕΡΟΣ 2ο
    2. Ασκήσεις στο θεώρημα Rolle
    3. Θεώρημα μέσης τιμής
    4. Ασκήσεις στο θεώρημα μέσης τιμής
    5. Σταθερές συναρτήσεις
    6. Ασκήσεις στις σταθερές συναρτήσεις
    7. Μονοτονία
    8. Ασκήσεις μονοτονίας
    9. Ακρότατα-θεώρημα Fermat
  10. Ασκήσεις στο θ.Fermat
  11. Ασκήσεις στα ακρότατα
  12. Κυρτότητα-Σημεία καμπής
  13. Ασκήσεις στην κυρτότητα-Σ. καμπής
  14. Ασύμπτωτες-Κανόνας του De l' Hospital
  15. Ασκήσεις στις ασύμπτωτες-De l' Hospital
  16. Μελέτη συνάρτησης
  17. Ερωτήσεις-Παράγωγοι 2ο μέρος
  18. Ασκήσεις επανάληψης στις παραγώγους
  19. Θέματα πανελληνίων έως και παράγωγοι
---
ΟΛΟΚΛΗΡΩΜΑΤΑ
Στην εξεταστέα ύλη του σχ. έτους 11-12 οι ενότητες 
1, 2, 3, 4  αντικαθίστανται με τις ενότητες  1α, 1β
  12. Ερωτήσεις - Ολοκληρώματα
  13. Επαναληπτικές ασκήσεις-ολοκληρώματα
---
ΓΕΝΙΚΑ ΘΕΜΑΤΑ
ΣΥΝΑΡΤΗΣΕΙΣ-ΟΡΙΟ-ΣΥΝΕΧΕΙΑ
    1. Συναρτήσεις
---
ΠΑΡΑΓΩΓΟΣ
---
ΣΤΑΤΙΣΤΙΚΗ
---
ΠΙΘΑΝΟΤΗΤΕΣ
---
ΓΕΝΙΚΑ ΘΕΜΑΤΑ
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---


Read more...

Κυριακή 13 Ιανουαρίου 2013

How to Make a Network Cable




The steps below are general Ethernet Category 5 (commonly known as Cat 5) cable construction guidelines. For our example, we will be making a Category 5e patch cable, but the same general method will work for making any category of network cables.
  1. 1
    Unroll the required length of network cable and add a little extra wire, just in case. If a boot is to be fitted, do so before stripping away the sleeve and ensure the boot faces the correct way.

    Kabeltester K40-XP

    PC-Kabeltester mit Kabeleditor schnell und einfach zu bedienen
    www.schibe.de
  2. 2
    Carefully remove the outer jacket of the cable.
    Carefully remove the outer jacket of the cable.
    Carefully remove the outer jacket of the cable. Be careful when stripping the jacket as to not nick or cut the internal wiring. One good way to do this is to cut lengthwise with snips or a knife along the side of the cable, away from yourself, about an inch toward the open end. This reduces the risk of nicking the wires' insulation. Locate the string inside with the wires, or if no string is found, use the wires themselves to unzip the sheath of the cable by holding the sheath in one hand and pulling sideways with the string or wire. Cut away the unzipped sheath and cut the twisted pairs about 1 1/4" (30 mm). You will notice 8 wires twisted in 4 pairs. Each pair will have one wire of a certain color and another wire that is white with a colored stripe matching its partner (this wire is called a tracer).
  3. 3
    Inspect the newly revealed wires for any cuts or scrapes that expose the copper wire inside.
    Inspect the newly revealed wires for any cuts or scrapes that expose the copper wire inside.
    Inspect the newly revealed wires for any cuts or scrapes that expose the copper wire inside. If you have breached the protective sheath of any wire, you will need to cut the entire segment of wires off and start over at step one. Exposed copper wire will lead to cross-talk, poor performance or no connectivity at all. It is important that the jacket for all network cables remains intact.
  4. 4
    Untwist the pairs so they will lay flat between your fingers.
    Untwist the pairs so they will lay flat between your fingers.
    Untwist the pairs so they will lay flat between your fingers. The white piece of thread can be cut off even with the jacket and disposed (see Warnings). For easier handling, cut the wires so that they are 3/4" (19 mm) long from the base of the jacket and even in length.
  5. 5
    Arrange the wires based on the wiring specifications you are following.
    Arrange the wires based on the wiring specifications you are following.
    Arrange the wires based on the wiring specifications you are following. There are two methods set by the TIA, 568A and 568B. Which one you use will depend on what is being connected. A straight-through cable is used to connect two different-layer devices (e.g. a hub and a PC). Two like devices normally require a cross-over cable. The difference between the two is that a straight-through cable has both ends wired identically with 568B, while a cross-over cable has one end wired 568A and the other end wired 568B.[1] For our demonstration in the following steps, we will use 568B, but the instructions can easily be adapted to 568A.
    • 568B - Put the wires in the following order, from left to right:

      • white orange
      • orange
      • white green
      • blue
      • white blue
      • green
      • white brown
      • brown
    • 568A - from left to right:
      • white/green
      • green
      • white/orange
      • blue
      • white/blue
      • orange
      • white/brown
      • brown
θέλουμε να εμφανίζονται μετά το "Διαβάστε περισσότερα". 
 
Read more...