demosensorp.nc
来自「tinyos-2.x.rar」· NC 代码 · 共 37 行
NC
37 行
module DemoSensorP
{
provides interface M16c62pAdcConfig;
provides interface Init;
uses interface GeneralIO as Pin;
uses interface GeneralIO as AVcc;
}
implementation
{
command error_t Init.init()
{
call Pin.makeInput();
// TODO(henrik) This Vref should be turned on in connection to the A/D
// converter code and not here.
// Turn on the Vref
call AVcc.makeOutput();
call AVcc.set();
}
async command uint8_t M16c62pAdcConfig.getChannel()
{
// select the AN0 = P10_0 to potentiometer on the expansion board.
return M16c62p_ADC_CHL_AN0;
}
async command uint8_t M16c62pAdcConfig.getPrecision()
{
return M16c62p_ADC_PRECISION_10BIT;
}
async command uint8_t M16c62pAdcConfig.getPrescaler()
{
return M16c62p_ADC_PRESCALE_4;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?