Skocz do zawartości

Mrpatryk

Użytkownicy
  • Zawartość

    170
  • Rejestracja

  • Ostatnio

Posty napisane przez Mrpatryk


  1. Witam, zakupiłem u skośnookich "braci" lcd TFT 3,2' z sterownikiem R61509 i niestety nigdzie nie mogę znaleźć biblioteki do niego ani żadnych tutoriali. Świeci się tylko na biało, touchpad udało się mi jakoś uruchomic i mam odczyty po serialu, ale za chiny nie mogę wyświetlić niczego ;/ Ktoś ma jakiś poradnik oraz biblioteki do niego? https://www.aliexpress.com/item/32952886221.html?spm=a2g0s.9042311.0.0.27424c4d61B3By


  2. #include <DigiCDC.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <Adafruit_Sensor.h>
    #include "Adafruit_BME680.h"
    #define SEALEVELPRESSURE_HPA (1013.25)
    Adafruit_BME680 bme; // I2C
    void setup() {
      SerialUSB.begin();
    
     
      SerialUSB.println(F("BME680 test"));
      
    
      if (!bme.begin(0x76)) 
      {
        SerialUSB.println("Could not find a valid BME680 sensor, check wiring!");
        while (1);
      }
     
     
     bme.setTemperatureOversampling(BME680_OS_8X);
     bme.setHumidityOversampling(BME680_OS_2X);
     bme.setPressureOversampling(BME680_OS_4X);
      bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
      bme.setGasHeater(320, 150); 
    }
     
    void loop() {
     
      if (! bme.performReading()) 
      {
        SerialUSB.println("Failed to perform reading :(");
        return;
      }
      SerialUSB.print("Temperature = ");
      SerialUSB.print(bme.temperature);
      SerialUSB.println(" *C");
     
    
    
      SerialUSB.print("Pressure = ");
      SerialUSB.print(bme.pressure / 100.0);
      SerialUSB.println(" hPa");
     
      SerialUSB.print("Humidity = ");
      SerialUSB.print(bme.humidity);
      SerialUSB.println(" %");
     
      SerialUSB.print("Gas = ");
      SerialUSB.print(bme.gas_resistance / 1000.0);
      SerialUSB.println(" KOhms");
     
    
     
      SerialUSB.print("Approx. Altitude = ");
      SerialUSB.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
      SerialUSB.println(" m");
     
     SerialUSB.println();
     
    
    
      SerialUSB.delay(2000);
    }

    Otrzymuje taki oto bład 😄

    Warning: Board tiny:tiny:attiny85at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY85AT1
    Warning: Board tiny:tiny:attiny24at16 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY24AT16
    Warning: Board tiny:tiny:attiny84at16 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY84AT16
    Warning: Board tiny:tiny:attiny4313at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY4313AT8
    Warning: Board tiny:tiny:attiny85at16p doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY85AT16P
    Warning: Board tiny:tiny:attiny44at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY44AT8
    Warning: Board tiny:tiny:attiny2313at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY2313AT8
    Warning: Board tiny:tiny:attiny45at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY45AT1
    Warning: Board tiny:tiny:attiny4313at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY4313AT1
    Warning: Board tiny:tiny:attiny84at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY84AT8
    Warning: Board tiny:tiny:attiny85at128 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY85AT128
    Warning: Board tiny:tiny:attiny84at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY84AT1
    Warning: Board tiny:tiny:attiny25at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY25AT8
    Warning: Board tiny:tiny:attiny44at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY44AT1
    Warning: Board tiny:tiny:attiny2313at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY2313AT1
    Warning: Board tiny:tiny:attiny85at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY85AT8
    Warning: Board tiny:tiny:attiny45at8 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY45AT8
    Warning: Board tiny:tiny:attiny25at1 doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY25AT1
    Warning: Board tiny:tiny:attiny85at16e doesn't define a 'build.board' preference. Auto-set to: TINY_ATTINY85AT16E
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In member function 'void SPISettings::init_AlwaysInline(uint32_t, uint8_t, uint8_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:146:16: error: 'SPE' was not declared in this scope
    
         spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
    
                    ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:146:27: error: 'MSTR' was not declared in this scope
    
         spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
    
                               ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:146:65: error: 'DORD' was not declared in this scope
    
         spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
    
                                                                     ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::beginTransaction(SPISettings)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:203:5: error: 'SPCR' was not declared in this scope
    
         SPCR = settings.spcr;
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:204:5: error: 'SPSR' was not declared in this scope
    
         SPSR = settings.spsr;
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static uint8_t SPIClass::transfer(uint8_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:209:5: error: 'SPDR' was not declared in this scope
    
         SPDR = data;
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:217:14: error: 'SPSR' was not declared in this scope
    
         while (!(SPSR & _BV(SPIF))) ; // wait
    
                  ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:217:25: error: 'SPIF' was not declared in this scope
    
         while (!(SPSR & _BV(SPIF))) ; // wait
    
                             ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static uint16_t SPIClass::transfer16(uint16_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:223:11: error: 'SPCR' was not declared in this scope
    
         if (!(SPCR & _BV(DORD))) {
    
               ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:223:22: error: 'DORD' was not declared in this scope
    
         if (!(SPCR & _BV(DORD))) {
    
                          ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:224:7: error: 'SPDR' was not declared in this scope
    
           SPDR = in.msb;
    
           ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:226:16: error: 'SPSR' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                    ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:226:27: error: 'SPIF' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:230:16: error: 'SPSR' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                    ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:230:27: error: 'SPIF' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:233:7: error: 'SPDR' was not declared in this scope
    
           SPDR = in.lsb;
    
           ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:235:16: error: 'SPSR' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                    ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:235:27: error: 'SPIF' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:239:16: error: 'SPSR' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                    ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:239:27: error: 'SPIF' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::transfer(void*, size_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:247:5: error: 'SPDR' was not declared in this scope
    
         SPDR = *p;
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:250:16: error: 'SPSR' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                    ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:250:27: error: 'SPIF' was not declared in this scope
    
           while (!(SPSR & _BV(SPIF))) ;
    
                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:255:14: error: 'SPSR' was not declared in this scope
    
         while (!(SPSR & _BV(SPIF))) ;
    
                  ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:255:25: error: 'SPIF' was not declared in this scope
    
         while (!(SPSR & _BV(SPIF))) ;
    
                             ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::setBitOrder(uint8_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:292:31: error: 'SPCR' was not declared in this scope
    
         if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);
    
                                   ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:292:43: error: 'DORD' was not declared in this scope
    
         if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);
    
                                               ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:293:10: error: 'SPCR' was not declared in this scope
    
         else SPCR &= ~(_BV(DORD));
    
              ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:293:24: error: 'DORD' was not declared in this scope
    
         else SPCR &= ~(_BV(DORD));
    
                            ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::setDataMode(uint8_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:298:5: error: 'SPCR' was not declared in this scope
    
         SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::setClockDivider(uint8_t)':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:303:5: error: 'SPCR' was not declared in this scope
    
         SPCR = (SPCR & ~SPI_CLOCK_MASK) | (clockDiv & SPI_CLOCK_MASK);
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:304:5: error: 'SPSR' was not declared in this scope
    
         SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((clockDiv >> 2) & SPI_2XCLOCK_MASK);
    
         ^
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:309:42: error: 'SPCR' was not declared in this scope
    
       inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
    
                                              ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:309:54: error: 'SPIE' was not declared in this scope
    
       inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
    
                                                          ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:4:0:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:310:42: error: 'SPCR' was not declared in this scope
    
       inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
    
                                              ^
    
    In file included from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,
    
                     from c:\users\patryk\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\interrupt.h:38,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/WProgram.h:8,
    
                     from C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/Arduino.h:4,
    
                     from sketch\sketch_aug11a.ino.cpp:1:
    
    C:\Users\Patryk\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\SPI/SPI.h:310:55: error: 'SPIE' was not declared in this scope
    
       inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
    
                                                           ^
    
    In file included from C:\Users\Patryk\Documents\Arduino\libraries\Adafruit_BME680_Library/bme680.h:63:0,
    
                     from C:\Users\Patryk\Documents\Arduino\libraries\Adafruit_BME680_Library/Adafruit_BME680.h:35,
    
                     from C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:6:
    
    C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino: In function 'void setup()':
    
    C:\Users\Patryk\Documents\Arduino\libraries\Adafruit_BME680_Library/bme680_defs.h:74:31: error: 'U8_C' was not declared in this scope
    
     #define UINT8_C(x)      U8_C(x)
    
                                   ^
    
    C:\Users\Patryk\Documents\Arduino\libraries\Adafruit_BME680_Library/bme680_defs.h:187:23: note: in expansion of macro 'UINT8_C'
    
     #define BME680_OS_8X  UINT8_C(4)
    
                           ^
    
    C:\Users\Patryk\Documents\Arduino\sketch_aug11a\sketch_aug11a.ino:23:33: note: in expansion of macro 'BME680_OS_8X'
    
      bme.setTemperatureOversampling(BME680_OS_8X);
    
                                     ^
    
    exit status 1
    Błąd kompilacji dla płytki Digispark (Default - 16.5mhz).

    Ktoś ma jakiś pomysł?  Pewnie czegoś brakuje w bibliotekach ;/


  3. #include <Wire.h>
    #include <SPI.h>
    #include <Adafruit_Sensor.h>
    #include "Adafruit_BME680.h"
     
     
    #define SEALEVELPRESSURE_HPA (1013.25)
     
    Adafruit_BME680 bme; // I2C
     
    void setup() {
      Serial.begin(9600);
      while (!Serial);
      Serial.println(F("BME680 test"));
     
      if (!bme.begin(0x76)) 
      {
        Serial.println("Could not find a valid BME680 sensor, check wiring!");
        while (1);
      }
     
      // Set up oversampling and filter initialization
      bme.setTemperatureOversampling(BME680_OS_8X);
      bme.setHumidityOversampling(BME680_OS_2X);
      bme.setPressureOversampling(BME680_OS_4X);
      bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
      bme.setGasHeater(320, 150); // 320*C for 150 ms
    }
     
    void loop() 
    {
      if (! bme.performReading()) 
      {
        Serial.println("Failed to perform reading :(");
        return;
      }
      Serial.print("Temperature = ");
      Serial.print(bme.temperature);
      Serial.println(" *C");
     
      Serial.print("Pressure = ");
      Serial.print(bme.pressure / 100.0);
      Serial.println(" hPa");
     
      Serial.print("Humidity = ");
      Serial.print(bme.humidity);
      Serial.println(" %");
     
      Serial.print("Gas = ");
      Serial.print(bme.gas_resistance / 1000.0);
      Serial.println(" KOhms");
     
      Serial.print("Approx. Altitude = ");
      Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
      Serial.println(" m");
     
      Serial.println();
      delay(3000);
    }

    podłaczony scl do D22 i sda do D21  zasilanie 3,3v oraz wspolne gnd, pod arduino dziala ale też zawyża i cały czas pokazuje 990hPa. Aktualnie problem z wgraniem tego kodu na esp32 ... ;/ 

    Teraz ma jakiś problem i wgl się ten program nie kompiluje ...  

    C:\Users\Patryk\Documents\Arduino\libraries\Adafruit_Unified_Sensor\Adafruit_Sensor.cpp:2:26: fatal error: avr/pgmspace.h: No such file or directory

    compilation terminated.

    exit status 1
    Błąd kompilacji dla płytki DOIT ESP32 DEVKIT V1.


  4. 25 minut temu, kaczakat napisał:

    Obawiam się, że ciągle mieszasz myślowo różne systemy walutowe. Jak przy kompilacji wybierzesz płytkę NODE MCU to wpisując jako argument funkcji 2 np. digitalWrite(2) to  sygnał pojawi się na pinie D4, ale ten sam kod skompilowany dla np. WIFIDuino będzie banglował pinem D2. Gdy w wybranej płytce jest Generic to na GPIO2, a użycie oznaczenia D2 wygeneruje błąd kompilacji, bo definicjach pinów nie ma przemapowanych numerów GPIO na piny typu D(numerek). Kiedyś będzie prościej, ale najpierw musisz to załapać. Możesz mieć też jakiś wynalazek, który ma pomieszane oznaczenia na płytce, łatwo to rozgryźć puszczając pętlę migania diodą po kolei na wszystkie dostępne piny.

    Czaje o czym mówisz , pod D4 = 2 , D2=4  wiem wiem, ale dziwne bo wszystko wczesniej działało 😄 tak to jest z chińskimi zamiennikami 😄 Posiadam nodemcu v3 wemos 😄 jakiś bubel :))


  5. 18 godzin temu, kaczakat napisał:

    No to świetnie, że działa, nie wiem co prawda jak, bo nie mógł działać bez zmian w kodzie lub podłączeniu -  definicje masz na pin 2, a podpięcie pod D2 gdzie jest to 4 (GPIO4).

    No właśnie ja też jestem zdziwiony, że to zadziałało a przedtem mialem podlaczone pod D0 a działało na D2 ... nie wiem jakim cudem .


  6. Bibliotekę ogarnąłem po wielu próbach nieudanego odpalenia czujnika am2302. Dzisiaj bede to testował. Dziwi mnie to tylko ze kod ktory napisałem z opcja wysyłania na serwer działał do czasu. Potem sie wieszal i musiałem resetowac az nic juz to nie dawalo. Dzisiaj to wytestuje. 


  7. Siemaneczko Podstawowy kod do Am2302 nie smiga na nodemcu v3 juz dostaje bialej gorączki, na arduino uno wszystko smiga nawet bez rezystora ... A nodemcu v3 ma focha i to juz 2 z koleii ...

    GND-> GND , 3,3v-3,3v (sprawdzane na osobnym zasilaniu 5v i wspolnej masie) , 2-> D2

    #include <cactus_io_AM2302.h>
     
     #define AM2302_PIN 2// what pin on the arduino is the AM2302 data line connected to
      // For details on how to hookup the AM2302 sensor to the Arduino then checkout this page
    // http://cactus.io/hookups/sensors/temperature-humidity/am2302/hookup-arduino-to-am2302-temp-humidity-sensor
      // Initialize AM2302 sensor for normal 16mhz Arduino.
      AM2302 dht(AM2302_PIN);
     // Note: If you are using a board with a faster processor than 16MHz then you need
      // to declare an instance of the AM2302 using
      // AM2302 dht(AM2302_DATA_PIN, 30);
     // The additional parameter, in this case here is 30 is used to increase the number of
      // cycles transitioning between bits on the data and clock lines. For the
      // Arduino boards that run at 84MHz the value of 30 should be about right.
      
      void setup(){
     Serial.begin(9600);
      Serial.println("AM2302 Humidity - Temperature Sensor");
    Serial.println("RH\tTemp (C)\tTemp (F)\tHeat Index (C)\tHeat Index (F)");
     
      dht.begin();
      }
      
      void loop(){
    // Reading temperature or humidity takes about 250 milliseconds!
      // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
      dht.readHumidity();
      dht.readTemperature();
      delay(2000);
      // Check if any reads failed and exit early (to try again).
      if (isnan(dht.humidity) || isnan(dht.temperature_C)) {
     Serial.println("AM2302 sensor read failure!");
     return;
     }
     
     Serial.print(dht.humidity); Serial.print(" %\t\t");
     Serial.print(dht.temperature_C); Serial.print(" *C\t");
     Serial.print(dht.temperature_F); Serial.print(" *F\t");
     Serial.print(dht.computeHeatIndex_C()); Serial.print(" *C\t");
     Serial.print(dht.computeHeatIndex_F()); Serial.println(" *F");
      // Wait a few seconds between measurements. The AM2302 should not be read at a higher frequency of
     // about once every 2 seconds. So we add a 3 second delay to cover this.
      delay(3000);
      }

     


  8. baterie mam 250mA, 3.7V chodzio to by to nie było wielkie max 3x3 cm . taka kostka .Dlatego zalezy mi na jakims układzie który bedzię w stanie z 2/3 miesiace wytrzymac bez wymiany baterii albo ładowania. 

    tak jak działaja stacje pogodwe od chiczyka łącznosc radiowa zasilana z 2 bateri AA i działa to z pol roku nieraz 😄 albo lepiej 


  9. Głownie chodzi o to ze nie wszędzie mam wifi , ale też chce zrobić czujniki ok 10 sztuk mobilne , przyczepiane " pudełeczko" z bateria 3.7V 250mA, jakims esp d1 v2 (może) no i dallasem, a chce by esp 32 to odbierało . Oczywiscie nie tylkotemperature , czujnik gazu itp . cos pod inteligencje budynkowa, dojdzie do tego dotykowy ekran TFT itp . 


  10. Witam, mam pytanko jak zrobić z ESP32 serwer (centrum dowodzenia) oraz chciałbym się doradzić czy lepiej użyć modułu z wifi jako klienta do przesłania wartości odczytów z czujników na ESP32 czy jednak lepiej kilka odbiorników radiowych rozlokowanych w pokojach ? Miał ktoś styczność z tym ?  Dodam ze chciałbym te wartości również przesyłać na stronę internetowa bądź do bazy danych dostępnej z całego świata.

×
×
  • Utwórz nowe...