Dear friends, please,
I have ESP01 ( ESP8266) and I please for advice how to declare pin
GPIO00 and GPIO002
I am trying
Sub Process_Globals
Private d1pins As D1Pins
Private d2 As Pin
Sub AppStart
d2.Initialize(d1pins.D2, d2.MODE_OUTPUT)
d2.DigitalWrite(False)
Sub OnOff
Dim b As Boolean
Dim x() As Byte
b = x(0) = 0
d2.DigitalWrite(b)
but I can not turn LED on end off...
Please for advice
p4ppc
I don't have that device here, but this:
is probably not doing what you think:
- in C, it will assign 0 to X(0), and then assign that to b also, which would be equivalent to false
- in BASIC, it would normally do a boolean comparison x(0) = 0, which will probably return True, and assign that to B
To track down that a pin is working, try alternating it True/False (or 1/0 or On/Off or High/Low) slow enough that you can check it with a logic probe or multimeter or oscilloscope.
Sub Process_Globals
Private d1pins As D1Pins
Private d2 As Pin
End Sub
Sub AppStart
d2.Initialize(d1pins.D2, d2.MODE_OUTPUT)
For NumFlashes = 1 to 10000
d2.DigitalWrite(False)
Sleep(1000)
d2.DigitalWrite(True)
Sleep(1000)
Next
End Sub
and if that doesn't do the job, then probably the LED is on a pin other than d1Pins.D2