Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetNetIf HTTPServer RPCInterface TextLCD mbed
Fork of RPC_HTTP by
Diff: HTTPServerExample.cpp
- Revision:
- 4:bf7431934cf5
- Parent:
- 3:4b05781a0988
- Child:
- 5:d93d164e1a11
--- a/HTTPServerExample.cpp Mon Oct 29 21:33:04 2012 +0000
+++ b/HTTPServerExample.cpp Mon Oct 29 22:59:27 2012 +0000
@@ -1,4 +1,5 @@
-/* HTTP and RPC */
+/* HTTP and RPC * MBED RECEIVES AND SEND DATA TO A VISUAL BASIC 2008 PROGRAMM */
+/* IP OF MBED IS USED BY VISUAL BASIC PRG */
#include "mbed.h"
#include "EthernetNetIf.h"
@@ -7,6 +8,7 @@
#include "RPCFunction.h"
#include "TextLCD.h"
+// The LCD is connected as below
TextLCD lcd(p21, p22, p23, p24, p25, p26); // rs, e, d4-d7
AnalogIn ain1(p15);
@@ -18,7 +20,7 @@
using namespace mbed;
//***************************************************************
-//Create a function of the required format LER DATA e HORA
+//Create a function of the required format - READ DATE and HOUR
void DateHour(char * input, char * output);
//Attach it to an RPC object
RPCFunction LeDataHora(&DateHour, "LeDataHora");
@@ -29,7 +31,7 @@
sprintf(output, "%s", ctime(&seconds));
}
//***************************************************************
-//Create a function of the required format CONTROLA BRILHO do LED
+//Create a function of the required format - CONTROL LED BRIGHT
void dimLed(char * input, char * output);
//Attach it to an RPC object
RPCFunction rpc_dimLed(&dimLed, "LedDimmer");
@@ -43,7 +45,7 @@
sprintf(output, "%f", x);
}
//**************************************************************
-// Função para ler voltagem do potenciometro
+//Create a function of the required format - READ THE POTENTIOMETER CONNECTED TO p15
void Levolt(char * input, char * output);
RPCFunction Voltagem(&Levolt, "Voltagem");
@@ -55,7 +57,7 @@
sprintf (output,"%2.2f", volt);
}
//**************************************************************
-// Função para ler a temperatura por meio de um LM35
+//Create a function of the required format - READ THE TEMPERATURE USING A LM35 CONNECTED TO p16
void Letemp(char * input, char * output);
RPCFunction Temperatura(&Letemp, "Temperatura");
@@ -68,21 +70,20 @@
}
//**************************************************************
-//Primeiro: crio as variaveis que vou usar via RPC
+//Create the variables
//float f;
//int i;
//char c;
-//Segundo: associo as variaveis aos RPCVariable Object
+//Connect the variables to the RPCVariable Object
//RPCVariable<float> rpc_f(&f, "f");
//RPCVariable<int> rpc_i(&i, "i");
//RPCVariable<char> rpc_c(&c, "c");
-//Defino os led´s e o botão
+//Define the LED´s and Buttons
DigitalOut led1(LED1, "led1");
DigitalOut led2(LED2, "led2");
DigitalOut led3(LED3, "led3");
-//DigitalOut led4(LED4, "led4");
-DigitalIn button1(p20, "button1");
+DigitalIn button1(p20, "button1");// BUTTON IS CONNECTED BETWEEN p20 AND VOUT VIA A 2.2K RESISTOR
LocalFileSystem fs("webfs");
@@ -132,7 +133,7 @@
Net::poll();
if(tm.read()>.1) {
//led1=!led1; //Show that we are alive
- printf("Funcionando...\n\r");
+ printf("Working...\n\r");
//time_t seconds = time(NULL);
//printf("Data e hora = %s\n\r", ctime(&seconds));
