Skip to content

Instantly share code, notes, and snippets.

@ahappyforest
Last active December 18, 2015 00:59
Show Gist options
  • Save ahappyforest/5700560 to your computer and use it in GitHub Desktop.
Save ahappyforest/5700560 to your computer and use it in GitHub Desktop.
configuration YL69HumidityC {
provides {
interface SplitControl;
interface Read<uint16_t>;
}
}
implementation {
components YL69HumidityControlP as Control;
components YL69HumidityP as Device;
components MicaBusC;
components new AdcReadClientC() as Adc;
components new TimerMilliC() as WarmupTimer; // 保证设备有足够的启动时间
// 1. Control
Control.Power -> MicaBusC.PW4
Control.Delay -> WarmupTimer;
SplitControl = Control.SplitControl;
// 2. Device
Device.SoilHumidityAdc -> MicazBusC.Adc7;
Device.Atm128AdcConfig <- Adc;
Read = Adc.Read;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment