Cubesat V1.0 2016 Código para mbed que envía y recibe datos

Dependencies:   Adafruit_GFX Adafruit_RTCLib MPL3115A2 SHTx mbed

Files at this revision

API Documentation at this revision

Comitter:
NilliM
Date:
Fri May 27 19:27:39 2016 +0000
Child:
1:92c8991a4213
Commit message:
Cubesat V1.0 2016

Changed in this revision

Adafruit_GFX.lib Show annotated file Show diff for this revision Revisions of this file
Adafruit_RTCLib.lib Show annotated file Show diff for this revision Revisions of this file
MPL3115A2.lib Show annotated file Show diff for this revision Revisions of this file
SHTx.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Adafruit_GFX.lib	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/oscarvzfz/code/Adafruit_GFX/#1673d5397d7b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Adafruit_RTCLib.lib	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/nkhorman/code/Adafruit_RTCLib/#2c4e81ecda67
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPL3115A2.lib	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/sophtware/code/MPL3115A2/#7c7c1ea6fc33
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SHTx.lib	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/NegativeBlack/code/SHTx/#8465801be23f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,75 @@
+#include "mbed.h"
+#include "SHTx/sht15.hpp"
+#include "Adafruit_SSD1306.h"
+#include "MPL3115A2.h"
+#include<stdio.h>
+
+//Puertos serial
+Serial pc(USBTX,USBRX);
+//Serial mx(p13,p14);
+Serial mm(p13,p14);
+
+//Sensores
+SHTx::SHT15 sensor(p21, p22); //Humedad sht
+I2C i2c(p28, p27);
+//MPL3115A2 sensors(&i2c, &pc);  //Altitud
+I2C myI2C(p9,p10); //Display
+Adafruit_SSD1306_I2c o(myI2C,D13,0x7A,64,128);
+
+
+
+int main() {
+    //sensors.init(); //Para sensor de altitud
+    //Altitude a;
+    //sensors.setOffsetAltitude(83);
+    sensor.setOTPReload(false);
+    sensor.setResolution(true);
+    //mx.baud(115200);
+    while(1) {
+         sensor.update(); //Humedad sht
+         //sensors.readAltitude(&a);
+        
+         
+         //Imprimir valores
+         char buffer[100];
+         char buffers[100];
+         mm.gets(buffer, 100);
+         for(int h=0; h<=100; h++)
+         {
+            if(buffer[h] == '@'){
+            for(int t=0; t<=100; t++)
+            {
+            buffers[t]=buffer[h];
+            h++;
+            if(buffer[h] == '#')
+            {
+            h=101;
+            t=101;
+                }
+            
+            }}}
+            //pc.printf("%c", buffers[h]);  
+            //pc.printf("%c", buffer[h]);
+          
+         //pc.printf("\nSensor de humedad\nTemperature: [ %3.2f C ]\n", sensor.getTemperature()); 
+         //pc.printf("Humdity:[ %3.2f %% ]\r\r\r\n\n", sensor.getHumidity()); //Humedad sht
+         
+         //pc.printf(" '%s'\n", buffers);  
+
+         //pc.printf("Altitude: %s#\r\n", a.print());
+         
+         //.printf ("%s\n",buffer);
+         mm.printf("%s", buffers);
+         mm.printf(",%2.2f,%3.1f, #\n", sensor.getTemperature(),sensor.getHumidity());
+         //mm.printf("%s,#", a.print());
+        
+        o.setTextCursor(0,0);
+        o.clearDisplay();
+        o.printf("%s", buffers);
+        o.printf(",%2.2f,%3.1f, #\n", sensor.getTemperature(),sensor.getHumidity());
+        //o.printf("%s,#", a.print());
+        
+        o.display();
+         }
+         
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 27 19:27:39 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e
\ No newline at end of file