Discover the secret life of plants! FLORANIUM FDRM-KL25Z Shield An experimental Polygraph for green plants. www.floranion.de

Dependencies:   FastPWM SPI_TFT_ILI9341 TFT_fonts

SOME BELIEVE PLANTS CAN FEEL OUR PRESENCE...

The FLORANIUM PROJECT is an innovative plant life indicator, similar to a humans polygraph, that allow you to visualize activities of living plants, caused by movement, touch, changes in climate, environment and many other elements of life. It's a whole new way to interact with green plants!

Please visit http://www.floranium.com or http://www.floranion.de for more information.

/media/uploads/lasmahei/screenshot_2018-02-14_13-35-22.png/media/uploads/lasmahei/floranium.png

Revision:
1:f95f37892056
Parent:
0:356e8d3c2cb7
Child:
2:de08bea849b8
--- a/main.cpp	Wed Feb 14 11:55:45 2018 +0000
+++ b/main.cpp	Wed Feb 21 18:41:26 2018 +0000
@@ -26,13 +26,19 @@
 #include "Arial28x28.h"
 #include "font_big.h"
 
-#define firmware 2.00
+#define firmware 1.00
 #define RGBmask 0xFF
 #define dacMask 0xFFF
 #define samples 100
 #define samplesOut 1000
 #define baudrate 115000
-#define QVGA true           //enter "false" here if no TFT Disülay is connected
+
+#define fullRangePWM true   // Outputs an analog Voltage over the Full Range of 3.3V at J12 Pin 1
+#define datalogger true     // SD Card Data Recording (Datalogger)
+#define dac true            // Outputs the analog Voltage of the RGB Color Wheel via DAC at J18 Pin 1 (To watch plant signal with an Oscilloscope)
+#define extRGB true         // RGB PWM at J19 Pins 1, 2, 3
+#define onBoardRGB true     // On Board RGB LED
+#define QVGA true           // TFT QVGA Display support
 
 /************************************** Inits ***************************************/
 // I/Os
@@ -49,7 +55,7 @@
 DigitalOut barDot5(PTC17);
 DigitalOut barDot4(PTC16);
 DigitalIn Record(PTB8);         //SD Card Data Record Switch
-PwmOut pwmAnalogOut(PTA13);     // PWM out for Analog Voltage. 
+FastPWM pwmAnalogOut(PTA13);     // PWM out for Analog Voltage. 
 AnalogOut aout(PTE30);          // Analog Out (DAC)
 
 //Using FastPWM for higher speed and resolution. Otherwise, the RGB LED will flicker  
@@ -270,16 +276,28 @@
             if(plantRGB > 170 && plantRGB <= 255) { red = (color*3)-2; green = 0; blue = (1-color)*3; }
     
             //FRDM-KL25Z RGB LED
-            r=1-red;
-            g=1-green; 
-            b=1-blue;
+            if (onBoardRGB)
+            {
+                r=1-red;
+                g=1-green; 
+                b=1-blue;
+            }
+            else
+            {
+                r=1;
+                g=1; 
+                b=1;
+            }
         
             //PWM Output RGB EXT (Shield Connector J19)
-            extRed=1-red;
-            extGreen=1-green;
-            extBlue=1-blue;
-            //aout = (1/colorRange)*plantRGB; // DAC Analog Out (J18)
-            //pwmAnalogOut = pwmNormVal; // PWM out for Analog Voltage (PWM: J15 and DC J12) Please Comment out RGB Color Display above if this PWM or/and Analog Output is used. 
+            if (extRGB)
+            {
+                extRed=1-red;
+                extGreen=1-green;
+                extBlue=1-blue;
+            }
+            if (dac) aout = (1/colorRange)*plantRGB; // DAC Analog Out (J18)
+            if (fullRangePWM) pwmAnalogOut = pwmNormVal; // PWM out for Analog Voltage (PWM: J15 and DC J12) Please Comment out RGB Color Display above if this PWM or/and Analog Output is used. 
         } 
         else 
         { 
@@ -346,7 +364,7 @@
     {
         data2serial();
         if (QVGA) data2TFT();
-        if (!Record)
+        if ((!Record) && (datalogger))
         {
             if (!SDmounted) // Mount SD-Card if not already mounted  
             {