Arduino Nano reads ADS1100 instances

Source: Internet
Author: User

Using the wire library of the Arduino Nano makes it easy to set up and read the converted data to the ADS1100.

/** Arduino reads ADS1100 i²c 16bit diff ADC*/  /*SDA ==> Analog 4 PC4 SCL ==> analog 5 PC5 set register:stby 0 0 SC DR1 DR0 PGA1 PG      A0 Default 1 0 0 0 1 1 0 0 0x8c I want 1 0 0 0 1 1 0    0 IGN 0 0 con 8SPS GAIN 1 STBY, only for single mode to start conversion SC  1= single, 0=continuous dr1:0 datarate xx = 128sps, bit-2048 to 2047 = 32sps,  14-8192 to 9191 = 16sps, 15-16384 to 16383 one = 8sps,  16-32768 to 32767 pga1:0 Gain XX = * *, * * *, ten = *, one = *8*/#include<Wire.h>//AD0 1001 r/w AD1 1001 001 r/w; r=1. w=0#defineAD0 B1001000//ADS1100 Address 0x48
#defineOptions B10001100//0x8c--8sps,16 bit accuracy, 1 time times magnificationuint8_t Reg=0; int16_t result=0;voidSetup () {Serial.begin (9600); Wire.begin (); Wire.begintransmission (AD0); Wire.write (options); Wire.endtransmission ();}voidLoop () {wire.begintransmission (AD0); Wire.requestfrom (AD0,3);//returns 3 bytes
       while(Wire.available ()) {result=Wire.read (); Result= Result <<8; Result+=Wire.read (); Reg=Wire.read ();         Serial.print (result, DEC); Serial.println ("\ t"); Serial.print ((3300.00* result)/0x7FFF, 2),//ads1100 3.3V power supply, if the 5V to replace 3300.00 to 5000.00 serial.println ("MV");  } wire.endtransmission (); Delay ( -);}

Arduino Nano reads ADS1100 instances

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.