In this way, we don't need to know what the single chip microcomputer has done, and we just need to connect wires. Actually, I can't use B4R. I tried to write a library for the first time. This library is incomplete and needs to be modified, but it is not clear what went wrong. My English is poor, so I have to rely on the browser to translate. Therefore, there are many incomprehensible places in the tutorial found.
B4X:
Sub Process_Globals
Public Serial1 As Serial
Dim myled As LED
Dim timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
myled.Initialize(13,True)
Log("AppStart")
timer1.Initialize("Timer1_Tick",100)
timer1.Enabled = True
End Sub
Private Sub Timer1_Tick
myled.on()
Delay(300)
myled.off()
Delay(300)
End Sub
1. Why do you need a library for this??? Use Pin instead of LED.
2. It is a mistake to use Delay to control the program flow. Use Timer or CallSubPlus.
1. Why do you need a library for this??? Use Pin instead of LED.
2. It is a mistake to use Delay to control the program flow. Use Timer or CallSubPlus.
The purpose of compiling this library is to make it easier for children to learn. They only need to know which foot led connects, and then led.on or led.off can control them. I used to teach Lego. Programming is too difficult for children, so I want to make it easier for them to get started.
1. Why do you need a library for this??? Use Pin instead of LED.
2. It is a mistake to use Delay to control the program flow. Use Timer or CallSubPlus.
I just want to learn how to package the B4R library, and I can't understand some of the tutorials I found. So I plan to try to package a minimum library by myself, which is convenient for my students to use