Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 2.0 - I2C not connecting with BMPO85

Threaded View

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Teensy 2.0 - I2C not connecting with BMPO85

    I recently got a BMP085 from Drotek, trying to connect it now with my new Teensy 2 (ordered via Ada 2 weeks ago).
    Sadly, I don't get aaaaany output, not even with basic code & simple examples like
    http://https://docs.google.com/viewe...MDMzZTZj&hl=fr

    Just wondering whether the chip got fried or what I might be doing wrong... Coding with Arduino 1.0.3 & latest teensyduino.
    Issues with libraries? With I2C-pins? (aaaaaaaaarghhh)
    Connect SCL with D0 (pin5), SDA with D1 (pin6) ... 5V running of VCC near the USB-plug.

    ** Code going FUBAR at dps.init...


    Click image for larger version. 

Name:	2013-03-01 21.07.49.jpg 
Views:	218 
Size:	163.4 KB 
ID:	293

    Code:
    #include <Wire.h>
    #include <BMP085.h>
    
    const int Speed = 19200;
    const int buzzPin = 4;
    
    char STRING[40]="";
    int32_t Pressure = 999999;
    int32_t Altitude = 99999; 
    
    int pitch=400;
    int count=12;
    
    BMP085 dps = BMP085();
    
    //=========================================================================
    
    void bleep(int toon=0) {
      tone(buzzPin,pitch,100);
      
      if (toon > 0) { delay(200); tone(buzzPin,pitch+150,150); }
    }
    
    //=========================================================================
    // the setup() method runs once, when the sketch starts
    
    void setup() {
    
      delay(5000);
      bleep();
    
      Wire.begin();
      Serial.begin(28800);
     
      Serial.println("Starting DPS\n");
      
      delay(1000);
      dps.init();
      delay(1500);
      
      bleep(1);
    
      Serial.println("DPS Started.");
     
     }
    
    //================================================================================
    void loop() {
    
      dps.getPressure(&Pressure);       delay(200);
      dps.getAltitude(&Altitude);
    
      sprintf(STRING,"%lu,%lu,%lu,%u,%u,",Pressure,Altitude);
      Serial.println(STRING);
    
      tone(buzzPin,pitch*count++/4-200,100);
    
      delay(200);
    }
    Last edited by fré; 03-01-2013 at 08:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •