Friday, July 29, 2016

Presenter / Laser pointer IOT DIY (5)

Added Infrared sensor and IR led to the IR presenter / laser pointer.
With the IR led this device can transmit IR codes and
with the IR sensor this small device with the ESP8266 can now also
- react to IR codes
- capture IR codes from remote controls


Current configuration of IOT Laser pointer / presenter:

' PinInit.bas
' JanJeronimus 2016
cls
' All pin variables
' (Orderd as print layout)

' Pin Button1 16 GPIO16
let PinButton1 = 16

' Pin IRin  14 GPIO14 / IR receive
let PinIRin = 14

' Pin IRsend 12 GPIO12 / RGB Green / IR send
let PinIRsend = 12

' Pin... 13 GPIO13 / RGB Blue

' PinLaser    5 GPIO4
let PinLaser = 5

' PinDHT11    4  GPIO5
PinDHT11 = 4

' Pin Reed / Button4 0 GPIO0
let PinReed = 0

' Pin Shake / Button5 2 GPIO2
let PinShake = 2

' PinBuzzer  15  GPIO15   /  RGB Red
PinBuzzer = 15

Device = "ESPD01"
' Other side of Button1-5 other signal connected to GND
' With DIP switches all can be connected to VCC or (and!!!) GND

' To save power consumption DHT11 power can be switched off with DIP switches

end 

On this blog you can find  a program for reading the IR sensor. published some time ago,
The updated (quick and dirty) version below has two buttons on the screen
CLR       - Start again (Clean up the screen)
                     ( yes it is 'dirty' and spoils the return stack, however it works )
MARK  - Print a star to the output as marker.
In the output is also a timestamp using the time() function  ( not the local time .. )

' IrRec2.bas
' JanJeronimus 2016
[AGAIN]
cls
html | <h1>IR</h1> |
html | This is the IR receive program <br> |
ir.recv.setup( 14 )
button "CLS" , [AGAIN]
button "MARK" , [MARK]
irbranch [DoIR]
html | <h2> Testing IR input</h2> |
wait

[MARK]
html | * |
wait

[DoIR]
html "<BR>IR received : " & ir.recv.full( ) & " : " & time()
returngui

return

end

No comments: