Basic programming question (sorry)
I am making a rpi-zero that glows a LED when there is a new mail.
I am such a noob when it comes to coding (which is why I love node-red). But I need a basic function that does
checks a mail account through the email-node and if there is a new mail then send a 1 out through output 1 and if not then send a 0.
Flow (without the function) here
[{"id":"954b31de.53c21","type":"e-mail in","z":"e87f6d57.f477f","name":"","protocol":"IMAP","server":"imap.gmail.com","useSSL":true,"port":"993","box":"INBOX","disposition":"None","criteria":"UNSEEN","repeat":"30","fetch":"auto","inputs":0,"x":90,"y":380,"wires":[["30e3a125.0b5afe"]]},{"id":"30e3a125.0b5afe","type":"function","z":"e87f6d57.f477f","name":"","func":"What to write here","outputs":2,"noerr":9,"x":270,"y":380,"wires":[["61a48cea.d931d4"],["61a48cea.d931d4"]]},{"id":"61a48cea.d931d4","type":"rpi-gpio out","z":"e87f6d57.f477f","name":"","pin":"11","set":"","level":"0","freq":"","out":"out","x":470,"y":380,"wires":[]}]
Thanks
Mathias