Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. inrepublica
    • Continue chat with inrepublica
    • Start new chat with inrepublica
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    inrepublica

    @inrepublica

    0
    Reputation
    3
    Posts
    863
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.inrepublica.fr Location France

    inrepublica Follow

    Posts made by inrepublica

    • How to deal with Time DST (daylight saving time) ?

      Hi all,

      In France we use daylight saving time.
      clocks was set forward by one hour in the spring ("spring forward") and set clocks back by one hour in autumn ("fall back") to return to standard time.

      how to deal with UIFlow?

      Thanks.

      posted in UIFlow
      inrepublica
    • RE: [M5 Fire] Wave playing?

      Thanks for your reply, when i test this code in UIFlow 1.7.7 on Fire:

      from machine import I2S
      import os, uos
      from wav import wave
      
      #initialize the I2S device
      i2s = I2S(  mode = I2S.MODE_MASTER | I2S.MODE_TX | I2S.MODE_DAC_BUILT_IN,
                  rate = 16000,
                  bits = 16,
                  channel_format = I2S.CHANNEL_ONLY_RIGHT,
                  data_format = I2S.FORMAT_I2S_MSB)
      
      #uncomment the following line if you have issues mounting the sd
      #uos.sdconfig(uos.SDMODE_SPI,clk=18,mosi=23,miso=19,cs=4)
      
      #create a function to play the wav
      def wav_player(fname):
          wav = wave.open(fname)
          i2s.set_dac_mode(I2S.DAC_RIGHT_EN)
          i2s.sample_rate(wav.getframerate())
          i2s.bits(wav.getsampwidth() * 8)
          i2s.nchannels(wav.getnchannels())
          i2s.volume(20)
      
          while True:
              data = wav.readframes(1024)
              if len(data) > 0:
                  i2s.write(data)
              else:
                  wav.close()
                  break
      
      # Playing WAV audio file
      lcd.clear()
      lcd.print('working',0,0,0xffffff)
      
      try:
          uos.mountsd()
      except:
          os.mountsd()
          lcd.print('sd card not mounted',0,50,0xffffff)
          pass
      
      while True:
              wav_player('/sd/test.wav')
              i2s.stop()
              wait(5)
      

      I have another error on line 39:

      module object has no attribute 'mountSD'

      posted in Cores
      inrepublica
    • [M5 Fire] Wave playing?

      Hi all,

      I try to follow this tutorial to play wav file on M5stack Fire: https://m5stack.hackster.io/lukasmaximus89/m5stack-rfid-face-wav-playing-flashcard-program-526cb5

      But I have a little problem with the module wave. When i run my micropython code i have an error on the fire:

      no module named 'wave'
      

      Thanks for your help.

      posted in Cores
      inrepublica