This is the device firmware for the imagingBoard on the DIY 3D Printable Raspberry Pi Raman Spectrometer. For more details please visit: http://hackaday.io/project/1279

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
flatcat
Date:
Thu Sep 18 10:43:20 2014 +0000
Parent:
10:f16d2d5bd04d
Commit message:
Added serial configuration for sensitivity.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f16d2d5bd04d -r 1851a9c7ce9c main.cpp
--- a/main.cpp	Sat Sep 13 11:20:16 2014 +0000
+++ b/main.cpp	Thu Sep 18 10:43:20 2014 +0000
@@ -26,13 +26,16 @@
 int shiftGate_width         = 33;    //microseconds
 */
 
+float firmwareVersion = 0.2;
+
+
 int masterFreq_period       = 2;    //microseconds
 int masterFreq_width        = 1;    //microseconds
 int shiftGate_period        = 8;    //microseconds
 int shiftGate_width         = 4;    //microseconds
 
 int none        = 0;
-int veryLow     = 1;
+int veryLow     = 10;
 int low         = 100;
 int mediumLow   = 1000;
 int medium      = 100000;
@@ -40,7 +43,7 @@
 int veryHigh    = 10000000;
 
 double imageData;
-int sensitivity             = high;
+int sensitivity;
 int pixelTotal              = 3694;
 int leadingDummyElements    = 16;
 int leadShieldedElements    = 13;
@@ -158,6 +161,15 @@
     }
 }
 
+void printInfo(){
+    raspi.printf("meridianScientific\r\n");
+    raspi.printf("ramanPi - The DIY 3D Printable RaspberryPi Raman Spectrometer\r\n");
+    raspi.printf("Spectrometer imagingBoard\r\n");
+    raspi.printf("-------------------------------------------------------------\r\n");
+    raspi.printf("Firmware Version: %f\r\n",firmwareVersion);
+    raspi.printf("Current Sensitivity: %d\r\n", sensitivity);
+}
+
 int main()
 {
     ICG = 1;
@@ -181,6 +193,7 @@
 
     raspi.baud(921600);
     blueLED = 0;
+    sensitivity = low;
     while(1) {
         if (state != readOut_IDLE)   //reading is top priority
         {
@@ -194,6 +207,27 @@
                 ICG = 0;
                 state = readOut_Begin;
                 break;
+            case 'l':
+                sensitivity = low;
+                break;
+            case 'v':
+                sensitivity = veryLow;
+                break;
+            case 'n':
+                sensitivity = mediumLow;
+                break;
+            case 'm':
+                sensitivity = medium;
+                break;
+            case 'h':
+                sensitivity = high;
+                break;
+            case 'c':
+                sensitivity = veryHigh;
+                break;
+            case 'i':
+                printInfo();
+                break;
             default:
                 break;
         }