| Electronic Components Datasheet Search |
|
DEV-13327 Datasheet(PDF) 5 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13327 Datasheet(HTML) 5 Page - SparkFun Electronics |
|
5 / 6 page ![]() u can take an // input above 3.3V! Keep your input voltages below 3.3V to avoid damage! adc.setRange(_0_512V); // getResult() returns a normalized floating point value r epresenting the // current voltage of the passed channel. User is respons ible for // logic to determine whether the value is at min or max. cout<<"Ch 0: "<<adc.getResult(0)<<endl; cout<<"Ch 1: "<<adc.getResult(1)<<endl; // getDiffResult() returns a normalized fp value represent ing the // difference between two channels. Options are // 0 Ch0 Ch1 // 1 Ch0 Ch3 // 2 Ch1 Ch3 // 3 Ch2 Ch3 cout<<"Ch 0 ch 1: "<<adc.getDiffResult(0)<<endl; // If you want to do the math yourself, you can determine the current gain // setting by using the getScaler() command. cout<<"Current scaler: "<<adc.getScaler()<<"V per bit"<<en dl; // The current voltage is the scaler/1000 multiplied by th e raw value. You // can get the raw ADC readings using the getRawResult() and // getRawDiffResult() functions. cout<<"Ch 0 raw: "<<adc.getRawResult(0)<<endl; cout<<"Ch 1 raw: "<<adc.getRawResult(1)<<endl; cout<<"Ch 0 ch 1 raw: "<<adc.getRawDiffResult(0)<<endl; // If you want to get *really* crazy, you can always go lo ok up the // datasheet and read and write the configuration registe r directly. cout<<"Config register: "<<hex<<adc.getConfigRegister()<<e ndl; // There's a "setConfigRegister()" function, too, which ex pects an // unsigned 16bit integer. Just FYI. return MRAA_SUCCESS; } Resources and Going Further Now that you have had a brief overview of the ADC Block, take a look at some of these other tutorials. These tutorials cover programming, Block stacking, and interfacing with the Intel Edison ecosystems. Edison General Topics: • General Guide to Sparkfun Blocks for Intel Edison • Edison Getting Started Guide • Loading Debian (Ubilinix) on the Edison Block Specific Topics: • ADC Block Git Repo • ADC Block CPP Library Git Repo Page 5 of 6 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |