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: Middleware EthernetInterface HC_SR04_Ultrasonic_Library mbed-rtos mbed
main.cpp
00001 /* 00002 00003 Main.cpp 00004 00005 Last update by RoHe 16/11/2015 00006 00007 */ 00008 #include <string.h> 00009 #include "mbed.h" 00010 #include "EthernetInterface.h" 00011 #include "rtos.h" 00012 #include "Sensors.h" 00013 #include "Ether.h" 00014 #include "Initial.h" 00015 #include "Threads.cpp" 00016 #include "StringManager.h" 00017 00018 00019 int main() 00020 { 00021 /*//////////////////////////////////// 00022 Initialization of the outports 00023 00024 Comments: 00025 -Inicialize all the output in zero 00026 -It has Pull - up 00027 */ 00028 ledRED=1; // it has pull-up 00029 ledGREEN=1; 00030 ledBLUE=1; 00031 00032 00033 /*//////////////////////////////////// 00034 SET Initial configuration and welcome message 00035 */ 00036 pc.baud(115200); 00037 pc.printf("Hello World from TCP Client-Server RoHE Main TASK GUS integrate YORCH1.\n\r"); 00038 00039 00040 /*////////////////////////////////// 00041 Declares all necessary CLASSES 00042 */ 00043 eth.init(); //Use DHCP 00044 eth.connect(); 00045 00046 serverTCP.bind(ECHO_SERVER_PORT1); 00047 serverTCP.listen(); 00048 00049 /*//////////////////////////////////// 00050 Declares all necessary INTERRUPTIONS 00051 */ 00052 sw2.fall(&sw2_press); 00053 00054 //////////////////////////////////////////////////////APPLICATION ///////////////////////////////////////////////////////// 00055 00056 pc.printf("Server IP Address is %s\r", eth.getIPAddress()); 00057 pc.printf("\nServer IP MAC address is %s\r", eth.getMACAddress); 00058 pc.printf("\nServer IP Gateway is %s\r", eth.getGateway()); 00059 pc.printf("\nServer IP network mask is %s\n\r", eth.getNetworkMask()); 00060 00061 00062 /*/////////////////////////////////// 00063 Declares all necessary THREADS 00064 */ 00065 Thread thread1(led_thread); 00066 Thread thread2(messsageFromClient); 00067 //Thread thread2(receivedFromServer1); 00068 /* 00069 QUESTIONS: 00070 -EMMA: para que sirve que yo reciba la IP del Broker 00071 -EMMA: Para que succes/fail si si se pudo prender o apagar ? 00072 -EMMA: Por que el get Room no sigue el mismo formato 00073 -JORGE: no hay una confirmacion del pin para setLight ocupamos un geLight 00074 00075 CONSTRAINS: 00076 -JORGE: meti las variables a Initial.h por que decia que se habian declarado mas 00077 de una vez. 00078 00079 TODO: 00080 -JORGE: leer el pin de salida para ver que si realmente se prende la Luz 00081 -COTA / PONCHO: ultrasonic 00082 -ROBER: manejo de string y como manejar las pruebas de fallos 00083 */ 00084 while(true) { 00085 global_people = GetPersonStatus(); 00086 //Thread::wait(2000); 00087 00088 }// END while 00089 //eth.disconnect(); 00090 }
Generated on Wed Jul 13 2022 23:01:55 by
1.7.2