Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Compatible with stm32duino #22210
    Grzegorz
    Participant

      Yes, I know, I changed it on purpose. But it doesn’t matter – it not works for me.

      in reply to: Compatible with stm32duino #22204
      Grzegorz
      Participant

        VSCopde + platformio.

        [env:blackpill_f401cc]
        platform = ststm32@^15.4.1
        board = blackpill_f401cc
        framework = arduino
        upload_protocol = dfu

        lib_deps =
        knolleary/PubSubClient@^2.8
        paulstoffregen/OneWire@^2.3.7
        milesburton/DallasTemperature@^3.10.0
        adafruit/Adafruit BME280 Library@^2.1.2
        marcoschwartz/LiquidCrystal_I2C@^1.1.4
        xreef/PCF8574 library@^2.2.1
        paulstoffregen/Time@^1.6
        stm32duino/STM32duino RTC@^1.3.0
        khoih-prog/NTPClient_Generic@^3.7.4
        khoih-prog/Timezone_Generic@^1.7.2
        luisllamasbinaburo/MedianFilterLib@^1.0.0
        forntoh/LcdMenu@^2.1.0
        khoih-prog/FlashStorage_STM32@^1.2.0
        bblanchon/ArduinoJson@^6.19.4
        jandrassy/EthernetENC@^2.0.2

        LCD 4×20 with pcf8574, relays with optoisolators (chinesee board).

        Attachments:
        You must be logged in to view attached files.
        in reply to: Compatible with stm32duino #22203
        Grzegorz
        Participant

          But when relayOff() is executed by RTC alarm I see in console output this message: “przekazniki off” but nothing happens with relays – still ON..

          in reply to: Compatible with stm32duino #22202
          Grzegorz
          Participant

            My setup:

            void setup(){
            beginRelays();
            delay(1000);
            relayOff();
            }

            void relayOff()
            {
            Serial.println(“przekazniki off”);
            expRelays.digitalWrite(relay_1, HIGH);
            expRelays.digitalWrite(relay_2, HIGH);
            expRelays.digitalWrite(relay_3, HIGH);
            expRelays.digitalWrite(relay_4, HIGH);
            }

            relayOff turn off relays after 10 seconds.
            But when I change code in relayOff() to manual Wire:
            Wire.beginTransmission(PCF8574relAddr);
            Wire.write(0xFF);
            Wire.endTransmission();

            It works right away, without any time delay.

            in reply to: Compatible with stm32duino #22201
            Grzegorz
            Participant

              Here, in this function:

              void beginRelays()
              {
              Wire.setClock(100000);
              expRelays.begin();
              expRelays.pinMode(SSR, OUTPUT); // gniazdo 230V
              expRelays.digitalWrite(SSR, LOW);
              expRelays.pinMode(Swiatlo, OUTPUT); // Oswietlenie
              expRelays.digitalWrite(Swiatlo, LOW);
              expRelays.pinMode(kbLED, OUTPUT); // klawiatura LED
              expRelays.digitalWrite(kbLED, HIGH);
              expRelays.pinMode(relay_1, OUTPUT); // przekaznik 1
              expRelays.digitalWrite(relay_1, HIGH);
              expRelays.pinMode(relay_2, OUTPUT); // przekaznik 2
              expRelays.digitalWrite(relay_2, HIGH);
              expRelays.pinMode(relay_3, OUTPUT); // przekaznik 3
              expRelays.digitalWrite(relay_3, HIGH);
              expRelays.pinMode(relay_4, OUTPUT); // przekaznik 4
              expRelays.digitalWrite(relay_4, HIGH);
              }

              And second function for buttons:

              void buttonsInit()
              {
              Serial.print(“init buttons “);
              Wire.setClock(100000);
              expButtons.begin();
              expButtons.pinMode(kbPower, INPUT_PULLUP); // klawiatura Power
              expButtons.pinMode(kbLeft, INPUT_PULLUP); // klawiatura Lewo
              expButtons.pinMode(kbMenu, INPUT_PULLUP); // klawiatura Menu
              expButtons.pinMode(kbAuto, INPUT_PULLUP); // klawiatura Auto
              expButtons.pinMode(kbRight, INPUT_PULLUP); // klawiatura Prawo
              expButtons.pinMode(btnLight, INPUT_PULLUP); // przycisk swiatla
              expButtons.pinMode(P6, INPUT);
              expButtons.digitalWrite(P6, LOW);
              expButtons.pinMode(P7, INPUT);
              expButtons.digitalWrite(P7, LOW);
              pinMode(kbInterruptPin, INPUT_PULLUP);
              attachInterrupt(digitalPinToInterrupt(kbInterruptPin), KbInterrupt, FALLING);
              }

              I’m using libraries:
              #include <LiquidCrystal_I2C.h>
              #include <LcdMenu.h> //https://forntoh.github.io/LcdMenu
              #include <Adafruit_BME280.h>
              #include <PCF8574.h>

              in reply to: Compatible with stm32duino #22196
              Grzegorz
              Participant

                it’s strange but it’s not working. Perhaps there is a conflict with some library what I use.

                in reply to: Compatible with stm32duino #21888
                Grzegorz
                Participant

                  There is nothing about setting clock/speed on i2c bus.
                  But when I write clear code like this:

                  Wire.setClock(100000);
                  Wire.begin();
                  Wire.beginTransmission(PCF8574relAddr);
                  Serial.print(“init relays “);
                  Wire.write(0x00);
                  Wire.endTransmission();
                  delay(1000);
                  Wire.beginTransmission(PCF8574relAddr);
                  Wire.write(0xFF);
                  Wire.endTransmission();

                  Work’s great. But when I increase clock.. Not working.

                  So… where I can set clock/speed of i2c in Your library?
                  Thank’s.

                  in reply to: Compatible with stm32duino #21782
                  Grzegorz
                  Participant

                    Or maybe change speed of i2c?
                    It’s possible in library?

                    in reply to: Compatible with stm32duino #21781
                    Grzegorz
                    Participant

                      there is some function was run when RTC interrupt set’s a flag:
                      On serial output i have message, but relays don’t change state.
                      When I compile this code on Arduino nano – all code works perfect.

                      void relayOff()
                      {
                      Serial.println(“relay off”);
                      expRelays.digitalWrite(relay_1, HIGH);
                      expRelays.digitalWrite(relay_2, HIGH);
                      expRelays.digitalWrite(relay_3, HIGH);
                      expRelays.digitalWrite(relay_4, HIGH);
                      }

                    Viewing 9 posts - 1 through 9 (of 9 total)