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

Files at this revision

API Documentation at this revision

Comitter:
lasmahei
Date:
Thu Feb 22 10:36:24 2018 +0000
Parent:
1:f95f37892056
Commit message:
Disabled Full Range PWM Output (J12 / J15). If this feature is used, please disable RGB PWMs in the source code!

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f95f37892056 -r de08bea849b8 main.cpp
--- a/main.cpp	Wed Feb 21 18:41:26 2018 +0000
+++ b/main.cpp	Thu Feb 22 10:36:24 2018 +0000
@@ -1,5 +1,5 @@
 /*******************************************************************************************
-    FLORANION SCI SHIELD for FRDM KL25Z REV2.00
+    FLORANION Scientific SHIELD for FRDM KL25Z REV2.00
     Discover the secret life of plants!
     (c) Martin Heine - Light Art Vision 2018 
 
@@ -26,14 +26,12 @@
 #include "Arial28x28.h"
 #include "font_big.h"
 
-#define firmware 1.00
-#define RGBmask 0xFF
-#define dacMask 0xFFF
-#define samples 100
-#define samplesOut 1000
-#define baudrate 115000
+#define firmware 1.00       // Firmware Version
+#define RGBmask 0xFF        // RGB Color resolution (0xFF = 8 Bit = 256 Colors)
+#define dacMask 0xFFF       // DAC Voltage resoltion
+#define samples 100         // Measuring samples 
+#define baudrate 115000     // Baudrate for serial monitor over USB
 
-#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
@@ -54,11 +52,12 @@
 DigitalOut barDot6(PTD4);
 DigitalOut barDot5(PTC17);
 DigitalOut barDot4(PTC16);
-DigitalIn Record(PTB8);         //SD Card Data Record Switch
-FastPWM pwmAnalogOut(PTA13);     // PWM out for Analog Voltage. 
-AnalogOut aout(PTE30);          // Analog Out (DAC)
+DigitalIn Record(PTB8);             // SD Card Data Record Switch
+//FastPWM pwmAnalogOut(PTA13);      // Optional PWM out for Analog Voltage. all RGB PWMs must be disabled!
+AnalogOut aout(PTE30);              // Analog Out (DAC)
 
 //Using FastPWM for higher speed and resolution. Otherwise, the RGB LED will flicker  
+
 //RGB LED on the FRDM KL25Z board 
 FastPWM r(LED_RED);
 FastPWM g(LED_GREEN);
@@ -124,16 +123,15 @@
 
 void initPWMs()
 {
-    r.period_ms(10);            // RGB LED PWM Frequency
+    r.period_ms(10);                // RGB LED PWM Frequency
     g.period_ms(10);
     b.period_ms(10);
     
-    extRed.period_ms(10);            // RGB extern PWM Frequency
+    extRed.period_ms(10);           // RGB extern PWM Frequency
     extGreen.period_ms(10);
     extBlue.period_ms(10);
-   
-    pwmAnalogOut.period_us(20);     //50kHz
-    //pwmAnalogOut.period_ms(5); // PWM out for Analog Voltage.
+    
+   //pwmAnalogOut.period_us(20);     //50kHz PWM out for Analog Voltage. RGB PWMs need to be disabled!
 } 
 
 void fadeBlue()
@@ -296,12 +294,13 @@
                 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. 
+            //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 
         { 
-            fadeBlue();
+            fadeBlue(); // fade blue LED slowly up and down if no plant is connected
             plantConnected = false;
         }
     }