This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

lm ambient buzzer
#1
I like to use the buzzer as posted in: Some LM Ambient questions (logicmachine.net)

But it doesn't work for me. Is there something changed?
And i also like to set the volume in a script.
Reply
#2
Which LM Ambient do you have and which fw? I just tried RC1 and it works.
------------------------------
Ctrl+F5
Reply
#3
(20.05.2021, 08:14)Daniel. Wrote: Which LM Ambient do you have and which fw? I just tried RC1 and it works.

LMWECO2-ZR
With latest rc1 firmware: LM Ambient V2: https://dl.openrb.com/lm-21-imx6/lmwallv2-20210510.img

And is it correct that this device doesn't display a pm25 value?
Reply
#4
Buzzer control for new HW (with volume control):
Code:
function beep(note, time, volume)
  volume = volume or 10
  volume = 1 + (11 - volume) ^ 2

  local period = math.floor(10 ^ 9 / note)
  local cycle = math.floor(period / volume)
  local path = '/sys/class/pwm/pwmchip3/pwm0/'

  io.writefile(path .. 'period', period)
  io.writefile(path .. 'duty_cycle', cycle)

  io.writefile(path .. 'enable', 1)
  os.sleep(time or 0.1)
  io.writefile(path .. 'enable', 0)
end
Reply
#5
(20.05.2021, 08:51)admin Wrote: Buzzer control for new HW (with volume control):
Code:
function beep(note, time, volume)
  volume = volume or 10
  volume = 1 + (11 - volume) ^ 2

  local period = math.floor(10 ^ 9 / note)
  local cycle = math.floor(period / volume)
  local path = '/sys/class/pwm/pwmchip3/pwm0/'

  io.writefile(path .. 'period', period)
  io.writefile(path .. 'duty_cycle', cycle)

  io.writefile(path .. 'enable', 1)
  os.sleep(time or 0.1)
  io.writefile(path .. 'enable', 0)
end

Thanks it works, and how lower the volume value, how harder the buzzer?

And is it correct that this device doesn't display a pm25 value?
Reply
#6
I suspect that the original firmware on your device was wrong and that your device does not have a PM2.5 sensor.
Reply


Forum Jump: