-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I have this code:
pub fn try_new(i2c_name: &str, channel: Sender<SelectorsEvent>) -> Result<Self> {
let i2c = I2cdev::new(i2c_name)?;
let mut adc = Ads1x1x::new_ads1015(i2c, TargetAddr::default());
let value = block!(adc.read(channel::DifferentialA0A1)).unwrap();
//TODO: Setup the ADC configuration
Ok(Self{adc, channel})
}but on the line block!(adc.read(channel::DifferentialA0A1)).unwrap() I get this error: expected a pattern, found a function call function calls are not allowed in patterns, why?
Toml:
[dependencies]
linux-embedded-hal = "0.4.0"
ads1x1x = "0.3.0"
nb = "1.1.0"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels