ESP 32 Lyrat V4.3

Place code snippets and demo code here
Post Reply
Michel Alexander
Posts: 43
Joined: Sun Aug 15, 2021 5:23 pm
Has thanked: 38 times
Been thanked: 12 times

ESP 32 Lyrat V4.3

Post by Michel Alexander »

a small program for the ESP32 Lyrat to test the board. Hope someone gives the inspiration for their own program

Code: [Local Link Removed for Guests]

' ****************************
' ESP 32 Lyrat V4.3
' by KM 05/2025
' ****************************
a$ = "---" ' Metadaten
PIN.MODE 36,INPUT 'REC Button
PIN.MODE 39,INPUT 'MODE Button
PIN.MODE 21,OUTPUT ' Lautsprecher 
PIN(21) = 1
DIM Sender$(2) = "http://icecast.ndr.de/ndr/ndr1wellenord/kiel/mp3/128/stream.mp3","https://stream.antenne.de/antenne"
Sender = 0 ' erster Sender bei Start
Laut = 50 'Lautstärke bei Start
OPTION.ES8388 18, 23
PlAY.SETUP 1 'externer DAC > ES8388
PLAY.VOLUME Laut ' Startlautstärke einstellen
onplay infos 'Metadaten lesen

timer1 1000, spielt


wait
 
spielt:
 if pin.touch(13) < 31 then 'Lautstärke verringern
 Laut = Laut - 5
  if Laut < 0 then
  Laut = 0
  endif
 endif
 if pin.touch(27) < 31 then 'Lautstärke erhöhern
 Laut = Laut + 5
  if Laut > 100 then
  Laut = 100
  endif
 endif
 
 if pin.touch(32) < 31 then 'Sender umschalten
 Sender = Sender + 1
  if Sender > 1 then
  Sender = 0
  endif
  play.STREAM Sender$(Sender)
 endif
 
PLAY.VOLUME Laut ' Startlautstärke einstellen  
 
 wlog time$,a$

 if play.isplaying = 0 then ' Kontrolle ob Stream läuft
 play.STREAM Sender$(Sender)
 zaehler = zaehler + 1
 endif
Return

infos: ' Metadaten auswerten
a$ =  play.message$
a$=replace$(a$, "StreamTitle=", "")
return
Post Reply