Quick Guide: Arduino Driver libraries

Atmel, PIC, VEX, Fischertechnik

Moderator: Moderatoren

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 20:59

(UART) GPS Modul GY-NEO-6M V2

GPS_GY-NEO-6M.JPG
GPS_GY-NEO-6M.JPG (10.98 KiB) 3402 mal betrachtet


Quelle: Ebay

Anschluss-Protokoll: UART
Spannung/Level: 3-5 V kompatibel
Bezugsquelle: u.a. Ebay, z.B. http://www.ebay.de/itm/311296066259
Preis: ca. 12-14 EUR


Treiber-Library:
Serial-lib (standardmäßig in Arduino-Sketch enthalten, standardmäßig bereits eingebunden)
GPS-lib: TinyGPS++ http://arduiniana.org/libraries/tinygpsplus/
https://github.com/mikalhart/TinyGPSPlus
TinyGPSPlus-master.zip
(43.44 KiB) 180-mal heruntergeladen

Anm.: auch für Raspberry Pi geeignet! https://bigdanzblog.wordpress.com/2015/ ... pberry-pi/

Hinweise:
1.) es lassen sich nicht nur geograf. Daten, sondern auch Datum, Uhrzeit, Geschwindigkeit, Kurs und Satellitendaten abfragen
2.) Üblicherweise arbeiten die Sketche für Uno und Nano mit SoftwareSerial():

Code: Alles auswählen

SoftwareSerial ss(4, 3);
void loop()
{
  while (ss.available() > 0)
    gps.encode(ss.read);
    //...

Stattdessen lässt sich aber auch Hardware-Serial verwenden, am besten per UART1 oder UART2 auf Mega oder Due:

Code: Alles auswählen

setup(){
  Serial.begin(115200);  // UART0 für USB-Serial-Terminal Window
  Serial1.begin(9600):   // UART1 für das GPS-Modul
}

void loop()
{
  while (Serial1.available() > 0)
    gps.encode(Serial1.read);
    //...
}

3.) Liste für die verfügbaren Daten:

Code: Alles auswählen

Serial.println(gps.location.lat(), 11); // Latitude in degrees (double)
Serial.println(gps.location.lng(), 11); // Longitude in degrees (double)
Serial.print(gps.location.rawLat().negative ? "-" : "+");
Serial.println(gps.location.rawLat().deg); // Raw latitude in whole degrees
Serial.println(gps.location.rawLat().billionths);// ... and billionths (u16/u32)
Serial.print(gps.location.rawLng().negative ? "-" : "+");
Serial.println(gps.location.rawLng().deg); // Raw longitude in whole degrees
Serial.println(gps.location.rawLng().billionths);// ... and billionths (u16/u32)

Serial.println(gps.date.value()); // Raw date in DDMMYY format (u32)
Serial.println(gps.date.year()); // Year (2000+) (u16)
Serial.println(gps.date.month()); // Month (1-12) (u8)
Serial.println(gps.date.day()); // Day (1-31) (u8)

Serial.println(gps.time.value()); // Raw time in HHMMSSCC format (u32)
Serial.println(gps.time.hour()); // Hour (0-23) (u8)
Serial.println(gps.time.minute()); // Minute (0-59) (u8)
Serial.println(gps.time.second()); // Second (0-59) (u8)
Serial.println(gps.time.centisecond()); // 100ths of a second (0-99) (u8)

Serial.println(gps.speed.value()); // Raw speed in 100ths of a knot (i32)
Serial.println(gps.speed.knots()); // Speed in knots (double)
Serial.println(gps.speed.mph()); // Speed in miles per hour (double)
Serial.println(gps.speed.mps()); // Speed in meters per second (double)
Serial.println(gps.speed.kmph()); // Speed in kilometers per hour (double)

Serial.println(gps.course.value()); // Raw course in 100ths of a degree (i32)
Serial.println(gps.course.deg()); // Course in degrees (double)

Serial.println(gps.altitude.value()); // Raw altitude in centimeters (i32)
Serial.println(gps.altitude.meters()); // Altitude in meters (double)
Serial.println(gps.altitude.miles()); // Altitude in miles (double)
Serial.println(gps.altitude.kilometers()); // Altitude in kilometers (double)
Serial.println(gps.altitude.feet()); // Altitude in feet (double)

Serial.println(gps.satellites.value()); // Number of satellites in use (u32)

Serial.println(gps.hdop.value()); // Horizontal Dim. of Precision (100ths-i32)



Einfaches Device Example :

Code: Alles auswählen

/*
   This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object.
   It requires the use of SoftwareSerial, and assumes that you have a
   9600-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
   Alternatively: Serial1 (RX1+TX1, pin 18+19 on Mega/Due)
*/

#include <TinyGPS++.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(22, 23, 24, 25, 26, 27);

static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;



double frac(double value) {
   return (value - (double)trunc(value) );
}



void setup()
{
  // setup Serial for USB-Monitor
  Serial.begin(115200);
 
  // setup Serial1 for GPS
  Serial1.begin(GPSBaud);
 
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);  // init LCD 1602

  Serial.println(F("DeviceExample.ino"));
  Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
  Serial.print(F("Testing TinyGPS++ library v. "));
  Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
}

void loop()
{
  char sbuf[128];
 
  // This sketch displays information every time a new sentence is correctly encoded.
  while (Serial1.available() > 0)
    if (gps.encode(Serial1.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}



void displayInfo()

  char sbuf[128];
  double   fLatt, fLong, fmin, fdecsec;
  uint16_t decdeg, decmin,
           dday, dmonth, dyear,
           dhour, dmin, dsec, dcsec, nsat;
 
  if (gps.location.isValid())
  {
    fLatt= (double)gps.location.lat();
    fLong= (double)gps.location.lng();
   
    sprintf(sbuf, "Lat:%+012.7f " , fLatt );     
    Serial.print(sbuf);   lcd.setCursor(0, 0);  lcd.print(sbuf);
   
    decdeg = (int)fLatt;
    fmin   = ( fLatt - (float)decdeg) * 60;
    decmin = (int)(fmin);
    fdecsec= (fmin - (float)decmin) * 60 ;
   
    sprintf(sbuf, "B%+04d:%02d'%7.4f ", decdeg, decmin, fdecsec);
    Serial.print(sbuf); lcd.setCursor(0, 0);  lcd.print(sbuf);
   
    sprintf(sbuf, " Lng:%+012.7f ", fLong );
    Serial.print(sbuf);     
   
    decdeg = (int)fLong;
    fmin   = ( fLong - (float)decdeg) * 60;
    decmin = (int)(fmin);
    fdecsec= (fmin - (float)decmin) * 60 ;
   
    sprintf(sbuf, "L%+04d:%02d'%7.4f ", decdeg, decmin, fdecsec);
    Serial.print(sbuf); lcd.setCursor(0, 1);  lcd.print(sbuf);
  }
  else
  {
    Serial.print(F("Location:  INVALID  "));
    lcd.setCursor(0, 1);  lcd.print("Loc.: INVALID");
  }

  if (gps.date.isValid())
  {     
    dday=gps.date.day();
    dmonth=gps.date.month();   
    dyear=gps.date.year();
    sprintf(sbuf, "  Date: %02d/%02d/%04d", dday, dmonth, dyear);
    Serial.print(sbuf);
  }
  else
  {
    Serial.print(F("  Date:  INVALID  "));
  }

  if (gps.time.isValid())
  {
    dhour=gps.time.hour();
    dmin= gps.time.minute();
    dsec= gps.time.second();
    dcsec=gps.time.centisecond();
    nsat =gps.satellites.value();
    sprintf(sbuf, "  Time: %02d:%02d:%02d,%03d Sat.=%02d", dhour, dmin, dsec, dcsec, nsat);
    Serial.print(sbuf);
  }
  else
  {
    Serial.print(F("  Time:  INVALID  "));
  }

  Serial.println();
}

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:04


DONATE / SPENDE:
Gefällt dir dieses Kompendium und möchtest du dafür einen kleinen Betrag über PAYPAL spenden ?
Dann klicke einfach auf diesen Link -
Ab einer Spende ab EUR 5,- kannst du auf Wunsch dieses Kompendium auch als kostenloses WORD.doc erhalten (per Email oder Download als .zip):

-> Ja, ich möchte etwas als Anerkennung spenden <-


Ein ganz herzliches Dankeschön! :prima:

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:05

( I²C ) ADS1115 4x ADC analog Multiplexer

Bild
https://cdn-shop.adafruit.com/1200x900/1085-02.jpg

Bezugsquellen:
Adafruit https://www.adafruit.com/product/1085
ähnliche auch per Ebay, Preis: ca. 4-10 EUR

I²C modes: Standard 100kHz, Fast 400kHz, Highspeed 4,4MHz
Resolution: 16-bit ADC

Lit.:
https://cdn-shop.adafruit.com/datasheets/ads1115.pdf
http://henrysbench.capnfatz.com/henrys- ... -tutorial/

Arduino-Treiber, Examples:
https://learn.adafruit.com/adafruit-4-c ... rogramming
https://github.com/adafruit/Adafruit_AD ... eended.pde

Code: Alles auswählen

#include <Wire.h>
#include <Adafruit_ADS1015.h>

// Adafruit_ADS1115 ads;  /* Use this for the 16-bit version */
Adafruit_ADS1015 ads;     /* Use thi for the 12-bit version */

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");
 
  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)");
 
  // The ADC input range (or gain) can be changed via the following
  // functions, but be careful never to exceed VDD +0.3V max, or to
  // exceed the upper and lower limits if you adjust the input range!
  // Setting these values incorrectly may destroy your ADC!
  //                                                                ADS1015  ADS1115
  //                                                                -------  -------
  // ads.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 3mV      0.1875mV (default)
  // ads.setGain(GAIN_ONE);        // 1x gain   +/- 4.096V  1 bit = 2mV      0.125mV
  // ads.setGain(GAIN_TWO);        // 2x gain   +/- 2.048V  1 bit = 1mV      0.0625mV
  // ads.setGain(GAIN_FOUR);       // 4x gain   +/- 1.024V  1 bit = 0.5mV    0.03125mV
  // ads.setGain(GAIN_EIGHT);      // 8x gain   +/- 0.512V  1 bit = 0.25mV   0.015625mV
  // ads.setGain(GAIN_SIXTEEN);    // 16x gain  +/- 0.256V  1 bit = 0.125mV  0.0078125mV
 
  ads.begin();
}

void loop(void)
{
  int16_t adc0, adc1, adc2, adc3;

  adc0 = ads.readADC_SingleEnded(0);
  adc1 = ads.readADC_SingleEnded(1);
  adc2 = ads.readADC_SingleEnded(2);
  adc3 = ads.readADC_SingleEnded(3);
  Serial.print("AIN0: "); Serial.println(adc0);
  Serial.print("AIN1: "); Serial.println(adc1);
  Serial.print("AIN2: "); Serial.println(adc2);
  Serial.print("AIN3: "); Serial.println(adc3);
  Serial.println(" ");
 
  delay(1000);
}

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:05

(I²C) PCF8591 : 4x ADC & 1x DAC analog Multiplexer

Bild

Resolution: 10 bit
Der IC arbeitet bei 2,5-6,0V, ist also auch für ARM cpus geeignet; max Bustakt ist 100kHz.
https://www.mikrocontroller.net/part/PCF8591

http://we.easyelectronics.ru/AVR/easy_i2c-avr-asm-praktikum-pcf8591-ds1307.html
http://tronixstuff.com/2013/06/17/tutorial-arduino-and-pcf8591-adc-dac-ic/

Bild

Code für 4x ADC:

Code: Alles auswählen

// http://tronixstuff.com/tutorials Chapter 52
// John Boxall June 2013

#include "Wire.h"
#define PCF8591 (0x90 >> 1) // I2C bus address
byte value0, value1, value2, value3;

void setup()
{
   Wire.begin();
   Serial.begin(9600);
}

void loop()
{
   Wire.beginTransmission(PCF8591); // wake up PCF8591
   Wire.write(0x04); // control byte - read ADC0 then auto-increment
   Wire.endTransmission(); // end tranmission
   Wire.requestFrom(PCF8591, 5);
   value0=Wire.read();
   value0=Wire.read();
   value1=Wire.read();
   value2=Wire.read();
   value3=Wire.read();
   Serial.print(value0); Serial.print(" ");
   Serial.print(value1); Serial.print(" ");
   Serial.print(value2); Serial.print(" ");
   Serial.print(value3); Serial.print(" ");
   Serial.println();
}


Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:05

Platzhalter

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:06

(I²C) PCF8574 : 8x IO Multiplexer (read/write)

Bild

http://garagelab.com/profiles/blogs/tutorial-arduino-i-o-port-expander-with-pcf8574

Bild

Arduino Playground:
https://playground.arduino.cc/Main/PCF8574Class

github Library:
https://github.com/RobTillaart/Arduino/ ... es/PCF8574
PCF8574 read/write Methoden:
https://github.com/RobTillaart/Arduino/ ... /PCF8574.h

Code: Alles auswählen

    void begin(uint8_t val=0xFF);
   
    uint8_t read8();
    uint8_t read(uint8_t pin);
    uint8_t value() const { return _dataIn; };

    void write8(const uint8_t value);
    void write(const uint8_t pin, const uint8_t value);
    uint8_t valueOut() const { return _dataOut; }

    //added 0.1.07/08 Septillion
    inline uint8_t readButton8(){ return PCF8574::readButton8(_buttonMask);}
    uint8_t readButton8(const uint8_t mask=0xFF);
    uint8_t readButton(const uint8_t pin);
    void setButtonMask(uint8_t mask);

    // rotate, shift, toggle expect all lines are output
    void toggle(const uint8_t pin);
    void toggleMask(const uint8_t mask);    // invertAll() = toggleMask(0xFF)
    void shiftRight(const uint8_t n=1);
    void shiftLeft(const uint8_t n=1);
    void rotateRight(const uint8_t n=1);
    void rotateLeft(const uint8_t n=1);

    int lastError();

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:07

Platzhalter

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:15

(I²C) MCP23017 : 16x IO-Multiplexer (read/write)

Bild
Bild

super Tutorial:
http://tronixstuff.com/2011/08/26/tutorial-maximising-your-arduinos-io-ports/

Bild

Code: Alles auswählen

 Example 41.3 - Microchip MCP23017 with Arduino
 http://tronixstuff.wordpress.com/tutorials > chapter 41
 John Boxall | CC by-sa-nc
*/
 
// pins 15~17 to GND, I2C bus address is 0x20
#include "Wire.h"
byte inputs=0;
 
void setup()
{
  Serial.begin(9600);
  Wire.begin(); // wake up I2C bus
 
  Wire.beginTransmission(0x20);
  Wire.write(0x00); // IODIRA register
  Wire.write(0x00); // set all of bank A to outputs
  Wire.endTransmission();
}
 
void loop()
{
  // read the inputs of bank B
  Wire.beginTransmission(0x20);
  Wire.write(0x13);
  Wire.endTransmission();
  Wire.requestFrom(0x20, 1);
  inputs=Wire.read();
 
  // now send the input data to bank A
  Wire.beginTransmission(0x20);
  Wire.write(0x12); // GPIOA
  Wire.write(inputs);    // bank A
  Wire.endTransmission();
  delay(200); // for debounce
}



alternativ:
Lib von Adafruit: https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/Adafruit_MCP23017.h

public Funktionen der Lib:

Code: Alles auswählen

class Adafruit_MCP23017 {
public:
  void begin(uint8_t addr);
  void begin(void);

  void pinMode(uint8_t p, uint8_t d);
  void digitalWrite(uint8_t p, uint8_t d);
  void pullUp(uint8_t p, uint8_t d);
  uint8_t digitalRead(uint8_t p);

  void writeGPIOAB(uint16_t);
  uint16_t readGPIOAB();
  uint8_t readGPIO(uint8_t b);

  void setupInterrupts(uint8_t mirroring, uint8_t open, uint8_t polarity);
  void setupInterruptPin(uint8_t p, uint8_t mode);
  uint8_t getLastInterruptPin();
uint8_t getLastInterruptPinValue();


Example Sketch: https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/examples/button/button.ino

Code: Alles auswählen

#include <Wire.h>
#include "Adafruit_MCP23017.h"

// Basic pin reading and pullup test for the MCP23017 I/O expander
// public domain!

// Connect pin #12 of the expander to Analog 5 (i2c clock)
// Connect pin #13 of the expander to Analog 4 (i2c data)
// Connect pins #15, 16 and 17 of the expander to ground (address selection)
// Connect pin #9 of the expander to 5V (power)
// Connect pin #10 of the expander to ground (common ground)
// Connect pin #18 through a ~10kohm resistor to 5V (reset pin, active low)

// Input #0 is on pin 21 so connect a button or switch from there to ground

Adafruit_MCP23017 mcp;
 
void setup() { 
  mcp.begin();      // use default address 0

  mcp.pinMode(0, INPUT);
  mcp.pullUp(0, HIGH);  // turn on a 100K pullup internally

  pinMode(13, OUTPUT);  // use the p13 LED as debugging
}



void loop() {
  // The LED will 'echo' the button
  digitalWrite(13, mcp.digitalRead(0));
}

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Mai 2016 21:16

Platzhalter

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 13. Nov 2016 14:05

(I²C) I2C Port Splitter PCA9548A / TCA9548A

Bild
https://www.bitwizard.nl/wiki/File:Dsc05850_edit.jpg

Lieferant: z.B. http://bitwizard.nl/shop/I2C-Splitter-Switch-with-PCA9548A-TCA9548A
Lit.: https://www.bitwizard.nl/wiki/I2C_splitter

Below is a sample sketch that will control TWO digital potentionmeters
having the same address, that live on two busses off the i2c splitter
board (BUS1, the second one, and BUS3, the fourth).

It is based on the I2C / "wire" library example that used to control
just ONE of those digital potentiometers.

Instead of

Wire.beginTransmission (addr);

you now have to do:

busBeginTransmission(byte bus,byte addr)

to start communicating with an i2c device on a specific bus. (the chip
allows you to select multiple busses at once, but you don't need that.
On the other hand, with two digital potentiometers at the same
address, you should be able to set them to the same value by selecting
both busses at the same time....busBeginTransmission (BUS1|BUS3, ...) )



Code: Alles auswählen


// I2C Digital Potentiometer
// by Nicholas Zambetti <http://www.zambetti.com>
// and Shawn Bonkowski <http://people.interaction-ivrea.it/s.bonkowski/>

// Demonstrates use of the Wire library
// Controls AD5171 digital potentiometer via I2C/TWI

// Created 31 March 2006

// This example code is in the public domain.

// This example code is in the public domain.


#include <Wire.h>

void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
}


// How are the jumpers set? 0 - 7
#define PCA_JUMPERS 0
#define ADDR_PCA  (0x70+PCA_JUMPERS)


void selectBus (byte bus)
{
  Wire.beginTransmission(44); // transmit to device #44 (0x2c)
  Wire.write(bus);            // sends control register byte 
  Wire.endTransmission();     // stop transmitting
}


// Use these values to select a bus. You COULD enable multiple
// busses at the same time, but normally that is not necessary.
#define BUS0 0x01
#define BUS1 0x02
#define BUS2 0x04
#define BUS3 0x08
#define BUS4 0x10
#define BUS5 0x20
#define BUS6 0x40
#define BUS7 0x80



void busBeginTransmission(byte bus,byte addr)
{
  selectBus (bus);
  Wire.beginTransmission (addr);
}


void busEndTransmission(void)
{
  Wire.endTransmission();     // stop transmitting
}


void busRequestFrom(byte bus,byte addr, byte num)
{
  selectBus (bus);
  Wire.requestFrom (addr, num);
}


byte val = 0;

void loop()
{

  busBeginTransmission(BUS1, 44); // transmit to device #44 (0x2c)
                              // device address is specified in datasheet
  Wire.write(byte(0x00));            // sends instruction byte 
  Wire.write(val);             // sends potentiometer value byte 
  busEndTransmission();     // stop transmitting

  busBeginTransmission(BUS3, 44); // transmit to device #44 (0x2c)
                              // device address is specified in datasheet
  Wire.write(byte(0x00));            // sends instruction byte 
  Wire.write(63 - val);             // sends potentiometer value byte 
  busEndTransmission();     // stop transmitting


  val++;        // increment value
  if(val == 64) // if reached 64th position (max)
  {
    val = 0;    // start over from lowest value
  }
  delay(500);
}


Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 13. Nov 2016 14:05

Platzhalter
Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Re: Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 26. Mai 2017 23:59


DONATE / SPENDE:
Gefällt dir dieses Kompendium und möchtest du dafür einen kleinen Betrag über PAYPAL spenden ?
Dann klicke einfach auf diesen Link -
Ab einer Spende ab EUR 5,- kannst du auf Wunsch dieses Kompendium auch als kostenloses WORD.doc erhalten (per Email oder Download als .zip):

-> Ja, ich möchte etwas als Anerkennung spenden <-


Ein ganz herzliches Dankeschön! :prima:
Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Re: Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 26. Mai 2017 23:59

( 1-wire ) DHT11 + DHT22 Humidity & Temperature Sensor Module

a) DHT11

Bild

Lit.:
https://playground.arduino.cc/Main/DHT11Lib
http://www.uugear.com/portfolio/dht11-h ... or-module/

Libraries: u.a.
https://github.com/adafruit/DHT-sensor-library
https://github.com/RobTillaart/Arduino/ ... /DHTstable (AVR, ARM, ESP)
https://github.com/RobTillaart/Arduino/ ... ies/DHTlib (AVR)


Preis: ab 1 EUR (z.B. Ebay)

Power Supply: 3.3~5.5V DC
Output: 3 (4) pin single row
Measurement Range: Humidity 20-90%RH, Temperature 0~50℃
Accuracy: Humidity +-5%RH, Temperature +-2℃
Resolution: Humidity 1%RH, Temperature 1℃
Interchangeability: Fully Interchange

Anschluss-Schema:
Arduino —————————– DHT11 Module
3-5V ———————————– VCC (V)
GND ———————————- GND (G)
Arduino DPin ——————– DATA (S)

Test-Codes:
Adafruit: https://github.com/adafruit/DHT-sensor- ... r/examples

Library: RobTillaart/Arduino: https://github.com/RobTillaart/Arduino/ ... e/examples
dht11_test.ino


b) DHT22
Die selben Libs unterstützen auch den DHT22, der einen größeren Messbereich hat:

http://www.mikrocontroller-elektronik.d ... tursensor/
Accuracy resolution: 0.1
Humidity range: 0-100%RH
Temperature range:-40~80°C
Humidity measurement precision:±2%RH
Temperature measurement precision:±0.5℃

Preis: ca. 3 EUR (Ebay)

Bild


HINWEIS:
Alternative für DHT11/22:
Adafruit BME280 Humidity + Barometric Pressure + Temperature (i2c) :
https://learn.adafruit.com/adafruit-bme ... duino-test
Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Re: Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 26. Jul 2017 13:30

Platzhalter
Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E

Benutzeravatar
HaWe
Administrator
Administrator
Beiträge: 5233
Registriert: 11. Jan 2006 21:01
Wohnort: ein kleiner Planet in der Nähe von Beteigeuze

Re: Quick Guide: Arduino Driver libraries

Beitragvon HaWe » 3. Jan 2018 14:50

(i2c, SPI) BMP280 Temperature & Barometric Pressure & Altitude
und BME280 (dto, zus. & Humidity) Sensor


BMP280_environment.jpg


BMP280 (ohne Humidity):
Lit.:
https://www.adafruit.com/product/2651
https://learn.adafruit.com/adafruit-bmp ... t/overview
Driver Source Code:
https://github.com/adafruit/Adafruit_BMP280_Library

BME280 (mit Humidity):
Lit.:
https://www.adafruit.com/product/2652
Driver Source Code:
https://github.com/adafruit/Adafruit_BME280_Library
Gruß,
HaWe
±·≠≈²³αβγδε∂ζλμνπξφωΔΦ≡ΠΣΨΩ∫√∀∃∈∉∧∨¬⊂⊄∩∪∅∞®
NXT NXC SCHACHROBOTER: https://www.youtube.com/watch?v=Cv-yzuebC7E


Zurück zu „allgemeine / Nicht-Lego-Robotik und Elektronik“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 8 Gäste

Lego Mindstorms EV3, NXT und RCX Forum : Haftungsauschluss