]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mulle/DemoSensorC.nc
nativ tos PrintF support, demosensors based on accelerometer, better low power
[tinyos-2.x.git] / tos / platforms / mulle / DemoSensorC.nc
index 568bb9ed79ef082289d4daab317e479c28d79e9c..3c88114e9381dec329b6d9e209c124c310e7b9ed 100755 (executable)
  */
 
 /**
- * A dumb demo sensor used for testing.
+ * Demo sensor that connects to the AN0 channel on the MCU. This can
+ * easily be used together with the potentiometer on the Mulle
+ * expansionboard.
  *
  * @author Henrik Makitaavola <henrik.makitaavola@gmail.com>
  */
-generic module DemoSensorC()
+generic configuration DemoSensorC()
 {
   provides interface Read<uint16_t>;
 }
 implementation
 {
-  uint8_t counter = 0;
-  
-  task void signalReadDone()
-  {
-    atomic uint8_t tmp = counter;
-    atomic counter++;
-    
-    signal Read.readDone(SUCCESS, tmp);
-  } 
-    
-  command error_t Read.read()
-  {
-    return SUCCESS;
-  }
-  default event void Read.readDone( error_t result, uint16_t val ) {}
+  components new AdcReadClientC(), DemoSensorP,
+             HplM16c62pGeneralIOC as IOs,
+             RealMainP;
+
+  DemoSensorP.Pin -> IOs.PortP100;
+  DemoSensorP.AVcc -> IOs.PortP76;
+
+  Read = AdcReadClientC;
+
+  AdcReadClientC.M16c62pAdcConfig -> DemoSensorP;
+
+  RealMainP.PlatformInit -> DemoSensorP;
 }