Introduction

Get help to code your device properly while attempting to get and send data through TheAmplituhedron.com.

Tags

Share

Cloud Code Generator

Advertisement:


read_later

Read Later



read_later

Read Later

Introduction

Get help to code your device properly while attempting to get and send data through TheAmplituhedron.com.

Tags

Share





Advertisement

Advertisement




What is Cloud Code Generator?

Cloud Code Generator is a plugin for the free cloud system of TheAmplituhedron.com, which helps you to program your device properly by taking instructions steps below.

tool-img
Figure - 2.1

Step-1

Please sign in to fill the required fields.

Step-2

Enter a valid IP address to make an HTTP request with your device.

Step-3

Enter your MAC address.

Step-4

Choose which board and device you want to program.

Step-5

Select the communication type.

Step-6

Decide whether your device request method is the get method or the post method.

Exceptions

* If your username contains blank space, you may have to replace them with %20(percent encoding character) depending on your board and device encoding to go to the accurate page.

* Do not use blank spaces in Code Generator Generator form fields.

* You can download default code files to modify by yourself below.













//-TheAmplituhedron.com
//-Cloud System
//-Sending data to TheAmplituhedron.com
//-Getting data from TheAmplituhedron.com
//
//-By Kutluhan Aktar

//
// * For more information, please go to https://www.theamplituhedron.com/dashboard/cloud/
// * This an example code file for Arduino Ethernet Shield 2 or ENC28J60.
//  * Do not forget to use percent-encoding reserved characters for the header. 
//  * Circuit:
//  * Ethernet shield attached to pins 10, 11, 12, 13
 
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
    MAC  // Your MAC address has to be here.
};
IPAddress ip(Ip-address); // A valid IP address to make an HTTP request.

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

// Define the sensors variables and types.
int Sensor_1;
String Sensor_2;
char Sensor_3;
float Sensor_4;
String Sensor_5;
char Sensor_6;

// Determine a string to collect the commands came from TheAmplituhedron.com.
String readString ;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  // Start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

void loop() {

  // Attach whatever data you want to send TheAmplituhedron.com
  Sensor_1 =  100;
  Sensor_2 =  "testString(1)";
  Sensor_3 = 'C'; 
  Sensor_4 =  123.456;
  Sensor_5 =  "testString(2)";
  Sensor_6 =  'A';
   
  // Listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // An http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        
        // Add each data came from TheAmplituhedron.com to a string named readString.
        if (readString.length() < 110) {
          readString += c;
          //Serial.print(c);
         }
        Serial.println(readString);
		        // If the line ends, initial a HTTP Request.
        if (c ==  '\n') {
		  
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");;
          client.println("Content-Type:text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html style=""background-color:#002699;"">");
          client.println("<head>");
          client.println("<title>DeviceSide</title>"); // Header for the web page.
          client.println("<link rel=""icon"" href=""https://www.theamplituhedron.com/images/favicon.ico""></link>"); // Describe the name and icon of DeviceSide.
          client.println("</head>");
          client.println("<body>");
          // The hedron must be send with the get method.
                    client.println("<form action=""  https://www.theamplituhedron.com/dashboard/cloud/username.php?hedron=userhedron "" method=""method"" target=""_parent"">"); // Enter your cloud page address. *Hedron here when the post method is active.

                    client.println("<input type=""hidden""  name=""hedron""value=""hedron""><br> "); // *Hedron here when the get method is active.				   
	                client.println("<button type=""submit"" style=""position:absolute;top:5px;width:100%;height:200px;background-color:#eb2e00;color:white;"">DeviceSide</button>"); // When the DeviceSide button is clicked, the information is sent to TheAmplituhedron.com by the valid IP address. 
                    client.println("<input type=""hidden""  name=""Sensor-1"" value="" ");
                    client.println(Sensor_1);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-2"" value="" ");
                    client.println(Sensor_2);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-3"" value="" ");
                    client.println(Sensor_3);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-4"" value="" ");
                    client.println(Sensor_4);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-5"" value="" ");
                    client.println(Sensor_5);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-6"" value="" ");
                    client.println(Sensor_6);
                    client.println(" ""><br> ");
          client.println("</form>");
          client.println("</body>");
          client.println("</html>");
          
          break;
        }

      }
    }
    delay(1);
    // Close the connection:
    client.stop();

    // Define conditions for your system.
      //  Device-1, Device-2, Device-3, Device-4, Device-5 are the constant on or off type.
        if (readString.indexOf("?Device-1=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("?Device-1=OFF") >0){ 
          // Condition here;
          }
        if (readString.indexOf("&Device-2=ON") >0){ 
          //  Condition here;
          }
        else if (readString.indexOf("&Device-2=OFF") >0){
          // Condition here;
          }
        
        if (readString.indexOf("&Device-3=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-3=OFF") >0){  
          // Condition here;
          }  
        if (readString.indexOf("&Device-4=ON") >0){
         // Condition here;
          }
        else if (readString.indexOf("&Device-4=OFF") >0){ 
          // Condition here;
          }
        if (readString.indexOf("&Device-5=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-5=OFF") >0){
          // Condition here;
          }
        
      //  Device-6 is the limitless text type.
        if (readString.indexOf("&Device-6=Data") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-6=Data") >0){ 
          // Condition here;
          }

        readString=""; // Start a new string.
  }
}
 
//-TheAmplituhedron.com
//-Cloud System
//-Sending data to TheAmplituhedron.com
//
//-By Kutluhan Aktar

//
// * For more information, please go to https://www.theamplituhedron.com/dashboard/cloud/
// * This an example code file for Arduino Ethernet Shield 2 or ENC28J60.
//  * Do not forget to use percent-encoding reserved characters for the header. 
//  * Circuit:
//  * Ethernet shield attached to pins 10, 11, 12, 13
 
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
    MAC  // Your MAC address has to be here.
};
IPAddress ip(Ip-address); // A valid IP address to make an HTTP request.

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

// Define the sensors variables and types.
int Sensor_1;
String Sensor_2;
char Sensor_3;
float Sensor_4;
String Sensor_5;
char Sensor_6;


void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  // Start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

void loop() {

  // Attach whatever data you want to send TheAmplituhedron.com
  Sensor_1 =  100;
  Sensor_2 =  "testString(1)";
  Sensor_3 = 'C'; 
  Sensor_4 =  123.456;
  Sensor_5 =  "testString(2)";
  Sensor_6 =  'A';
   
  // Listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // An http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        
        Serial.println(readString);
		        // If the line ends, initial a HTTP Request.
        if (c ==  '\n') {
		  
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");;
          client.println("Content-Type:text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html style=""background-color:#002699;"">");
          client.println("<head>");
          client.println("<title>DeviceSide</title>"); // Header for the web page.
          client.println("<link rel=""icon"" href=""https://www.theamplituhedron.com/images/favicon.ico""></link>"); // Describe the name and icon of DeviceSide.
          client.println("</head>");
          client.println("<body>");
          // The hedron must be send with the get method.
                    client.println("<form action=""  https://www.theamplituhedron.com/dashboard/cloud/username.php?hedron=userhedron "" method=""method"" target=""_parent"">"); // Enter your cloud page address. *Hedron here when the post method is active.

                    client.println("<input type=""hidden""  name=""hedron""value=""hedron""><br> "); // *Hedron here when the get method is active.				   
	                client.println("<button type=""submit"" style=""position:absolute;top:5px;width:100%;height:200px;background-color:#eb2e00;color:white;"">DeviceSide</button>"); // When the DeviceSide button is clicked, the information is sent to TheAmplituhedron.com by the valid IP address. 
                    client.println("<input type=""hidden""  name=""Sensor-1"" value="" ");
                    client.println(Sensor_1);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-2"" value="" ");
                    client.println(Sensor_2);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-3"" value="" ");
                    client.println(Sensor_3);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-4"" value="" ");
                    client.println(Sensor_4);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-5"" value="" ");
                    client.println(Sensor_5);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-6"" value="" ");
                    client.println(Sensor_6);
                    client.println(" ""><br> ");
          client.println("</form>");
          client.println("</body>");
          client.println("</html>");
          
          break;
        }

      }
    }
    delay(1);
    // Close the connection:
    client.stop();

  }
}
 
//-TheAmplituhedron.com
//-Cloud System
//-Getting data from TheAmplituhedron.com
//
//-By Kutluhan Aktar

//
// * For more information, please go to https://www.theamplituhedron.com/dashboard/cloud/
// * This an example code file for Arduino Ethernet Shield 2 or ENC28J60.
//  * Do not forget to use percent-encoding reserved characters for the header. 
//  * Circuit:
//  * Ethernet shield attached to pins 10, 11, 12, 13
 
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
    MAC  // Your MAC address has to be here.
};
IPAddress ip(Ip-address); // A valid IP address to make an HTTP request.

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

// Determine a string to collect the commands came from TheAmplituhedron.com.
String readString ;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);

  // Start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

void loop() {
   
  // Listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // An http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        
        // Add each data came from TheAmplituhedron.com to a string named readString.
        if (readString.length() < 110) {
          readString += c;
          //Serial.print(c);
         }
        Serial.println(readString);
        
        // If the line ends, initial a HTTP Request.
        if (c == '\n') {
          // send a standard http response header
		  
          client.println("HTTP/1.1 200 OK");;
          client.println("Content-Type:text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html style=""background-color:#002699;"">");
          client.println("<head>");
          client.println("<title>DeviceSide</title>"); // Header for the web page.
          client.println("<link rel=""icon"" href=""https://www.theamplituhedron.com/images/favicon.ico""></link>"); // Describe the name and icon of DeviceSide.
          client.println("</head>");
          client.println("<body>");
          client.println("</body>");
          client.println("</html>");
          
          break;
        }

      }
    }
    delay(1);
    // Close the connection:
    client.stop();
	
    // Define conditions for your system.
      //  Device-1, Device-2, Device-3, Device-4, Device-5 are the constant on or off type.
        if (readString.indexOf("?Device-1=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("?Device-1=OFF") >0){ 
          // Condition here;
          }
        if (readString.indexOf("&Device-2=ON") >0){ 
          //  Condition here;
          }
        else if (readString.indexOf("&Device-2=OFF") >0){
          // Condition here;
          }
        
        if (readString.indexOf("&Device-3=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-3=OFF") >0){  
          // Condition here;
          }  
        if (readString.indexOf("&Device-4=ON") >0){
         // Condition here;
          }
        else if (readString.indexOf("&Device-4=OFF") >0){ 
          // Condition here;
          }
        if (readString.indexOf("&Device-5=ON") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-5=OFF") >0){
          // Condition here;
          }
        
      //  Device-6 is the limitless text type.
        if (readString.indexOf("&Device-6=Data") >0){ 
          // Condition here;
          }
        else if (readString.indexOf("&Device-6=Data") >0){ 
          // Condition here;
          }

        readString=""; // Start a new string.
  }
}


Please Fill The

Required Fields



*Do Not Select

Fields Under

Construction


Downloads



Arduino Multi-Channel Get Method

Download


Arduino Multi-Channel Post Method

Download


Arduino Only Send Get Method

Download


Arduino Only Send Post Method

Download


Arduino Only Get

Download