Breathing light is a status light really, also used for notification if a new message arrives or perhaps if you missed a phone call. you might want to consider turning it off if you are concerned with battery life as it does use a bit more, tho i am not sure if it is that significant.
Source code
#include"arduino.h"#include <util/delay.h>#define SigPin 2#define CYCLE 1500void setup() { // put your setup code here, to run once: pinMode(SigPin,OUTPUT); digitalWrite(SigPin,LOW);}void loop() { int count; // put your main code here, to run repeatedly: digitalWrite(SigPin,LOW); _delay_ms(600); for(count=1;count<CYCLE;count++) { digitalWrite(SigPin,HIGH); _delay_us(count); digitalWrite(SigPin,LOW); _delay_us(CYCLE-count); } digitalWrite(SigPin,HIGH); for(count=CYCLE-1;count>0;count--) { digitalWrite(SigPin,HIGH); _delay_us(count); digitalWrite(SigPin,LOW); _delay_us(CYCLE-count); } _delay_ms(600);}
Leave a Reply
You must be logged in to post a comment.