L Lee Ingram Member Licensed User Longtime User May 17, 2024 #1 I want to send 38khz on pin 13, but line 7 does not seem to work. It only want 1 parameter. How else can I do this? B4X: Copy Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") irsend.Enable(13,38) 'frequency = 38khz timer1.Initialize("timer1_Tick", 500) timer1.Enabled = True End Sub
I want to send 38khz on pin 13, but line 7 does not seem to work. It only want 1 parameter. How else can I do this? B4X: Copy Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") irsend.Enable(13,38) 'frequency = 38khz timer1.Initialize("timer1_Tick", 500) timer1.Enabled = True End Sub
K KiloBravo Active Member Licensed User Longtime User May 18, 2024 #2 Read this post https://www.b4x.com/android/forum/threads/ir-send-and-receive.69454/#content What module are you using ? There are two libraries. One for the esp8266 and one for an arduino. The esp8266 library takes two parameters in the enable. This code from the example works on my esp8266. Code: Copy Sub Process_Globals Public Serial1 As Serial Private irsend As IrSend Private timer1 As Timer Public extras As ESP8266extras Public dpins As D1Pins End Sub Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") irsend.Enable(dpins.D8,38) timer1.Initialize("timer1_Tick", 500) timer1.Enabled = True End Sub Sub Timer1_Tick Dim m As UInt = Bit.And(Millis, 0xfff) 'get 12 bits Log("sending: ", m) irsend.SendRC5(m, 12) End Sub Upvote 0
Read this post https://www.b4x.com/android/forum/threads/ir-send-and-receive.69454/#content What module are you using ? There are two libraries. One for the esp8266 and one for an arduino. The esp8266 library takes two parameters in the enable. This code from the example works on my esp8266. Code: Copy Sub Process_Globals Public Serial1 As Serial Private irsend As IrSend Private timer1 As Timer Public extras As ESP8266extras Public dpins As D1Pins End Sub Private Sub AppStart Serial1.Initialize(115200) Log("AppStart") irsend.Enable(dpins.D8,38) timer1.Initialize("timer1_Tick", 500) timer1.Enabled = True End Sub Sub Timer1_Tick Dim m As UInt = Bit.And(Millis, 0xfff) 'get 12 bits Log("sending: ", m) irsend.SendRC5(m, 12) End Sub
K KiloBravo Active Member Licensed User Longtime User May 18, 2024 #3 I am a little rusty myself. It took me 30 minutes to find the library on the forum, download and extract it, grab an esp8266, create a new project, copy Erel's code, set up a test board, compile the program, and get it running on the hardware! Upvote 0
I am a little rusty myself. It took me 30 minutes to find the library on the forum, download and extract it, grab an esp8266, create a new project, copy Erel's code, set up a test board, compile the program, and get it running on the hardware!
L Lee Ingram Member Licensed User Longtime User May 19, 2024 #4 KiloBravo said: I am a little rusty myself. It took me 30 minutes to find the library on the forum, download and extract it, grab an esp8266, create a new project, copy Erel's code, set up a test board, compile the program, and get it running on the hardware! Click to expand... Thank you. I added the ESP8266extras library and tried it again. Everything is working perfectly, now. Upvote 0
KiloBravo said: I am a little rusty myself. It took me 30 minutes to find the library on the forum, download and extract it, grab an esp8266, create a new project, copy Erel's code, set up a test board, compile the program, and get it running on the hardware! Click to expand... Thank you. I added the ESP8266extras library and tried it again. Everything is working perfectly, now.
K KiloBravo Active Member Licensed User Longtime User May 19, 2024 #5 Glad I could help. Always frustrating when you can't get a project to work. Upvote 0