Scheduler for Arduino – Blink LEDs periodically


//variables for LED blinking
boolean flag0 = 0;
boolean flag1 = 0;
boolean flag2 = 0;
boolean flag3 = 0;
boolean toggle0 = 0;
boolean toggle1 = 0;
boolean toggle2 = 0;
boolean toggle3 = 0;

//counter for tasks
long int count = 0;

//variable to store number of times button pressed
int buttonpress = 0;

void setup()

//set pins as outputs
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

//Serial display to show number of times button pressed
pinMode(A0, INPUT);

//Enable watchdog timer with timeout of 4 seconds

cli();//stop interrupts

//set timer1 interrupt at 1Hz
TCCR1A = 0;// set entire TCCR1A register to 0
TCCR1B = 0;// same for TCCR1B
TCNT1 = 0;//initialize counter value to 0
// set compare match register for 1 hz increments
OCR1A = 15625;// = (16*10^6) / (15625 * 1024) (1024 Prescalar)
// turn on CTC mode
TCCR1B |= (1 << WGM12);
// Set CS12 and CS10 bits for 1024 prescaler
TCCR1B |= (1 << CS12) | (1 << CS10);
// enable timer compare interrupt
TIMSK1 |= (1 << OCIE1A);

PCICR =0x02; // Enable PCINT1 interrupt
PCMSK1 = 0b00000001; // Select Pin A0

sei();//allow interrupts

}//end setup

{//timer1 interrupt 1 Hz


if(count == 801)
count = 0;

flag0 = 0;

if(count % 2 == 0)
flag1 = 0;

if(count % 4 == 0)
flag2 = 0;

if(count % 8 == 0)
flag3 = 0;


{ // Interrupt service routine. Interrupt on A0 pin change

if (digitalRead(A0)==0)
Serial.print("button press = ");

void loop()

if(flag0 == 0) // Task1 – Blink LED every 1 s on pin 10
toggle0 = !toggle0;
flag0 = 1;

if(flag1 == 0) // Task2 – Blink LED every 2 s on pin 11
toggle1 = !toggle1;
flag1 = 1;

if(flag2 == 0) // Task3 – Blink LED every 4 s on pin 12
toggle2 = !toggle2;
flag2 = 1;

if(flag3 == 0) // Task 4 – Blink LED every 8 s on pin 13
toggle3 = !toggle3;
flag3 = 1;

//Reset the watchdog timer

Congrats Sachin.. Well Done India..



    Sachin has crossed 17K runs in ODI. That’s a remarkable achievement. And the way he played in today’s match against Australia is simply amazing. Hitting 175 off 141 balls was unbelievable! His today’s game reminded me of the Master Blaster I used to watch in my school days. I was a fan of Sachin and loved watch him play in every game. Fours, Sixes, sending balls to every corner of the ground.. It was Sachin’s era then. But wait. He still rules. His era is not over. Remember he scored his 45th hundred today. He is truly a legend! One of the legends of cricket whom the world bestows upon, the legend whom the upcoming cricketers would take ideal as.

    And what do I say about today’s game. Australia set a target of 350. And India lost by 3 runs. Now that’s reaaaaaaaaly close. This is the second match in the series India is losing so closely. India deserved to win today. Aus would have won, but in the whole series India is emerging as a stronger team and dominating team. There are no easy let-offs. Ind – Aus series are fun to watch, especially when finishes are the ones like todays.

Fake IPL player more popular than IPL

The Fake IPL player takes 2nd position in the google trends (india) whereas the ipl live score takes 5th position.


google-trendsJust check out the google trends results. There are more people searching for the fake ipl player than the ipl itself. Check out the posts by the fake ipl player @ This guy has got wits. This mysterious blogger claims to be a player from KKR. Some ppl believe this is a publicity stunt from PR of KKR while others believe its someone with a decent knowledge of cricket faking himself as IPL player. But whoever it is, his posts are real fun.


We love mystery. 🙂

Delhi 6 : Movie Review

delhi6    What was this movie all about? I am confused. For facts, this is a movie directed by Rakeysh Omprakash Mehra of Rang De Basanti fame. Lyrics by Prasoon Joshi and music by A.R. Rahman. The movie stars Abhishek Bachchan & Sonam Kapoor.


    I would like to describe the movie in 2 parts, the one before the intermission and one after.


First Half –

    Roshan (Abhishek Bachchan) returns to India from US of A to with his grandmother so that she can spend her last days in Chandni Chowk, a part of Delhi. He gets familiar with the neighbours, gets to meet Bittu (Sonam Kapoor), spends good amount of time clicking pictures with his Motorola handset and watching Ram Leela innumerable times with his grandmother. The movie goes on with subtle humour here and there. There is one plot where a inspector is seen bullying locals. Amused Roshan demands that the inspector can’t treat people like that and reminds him he is a Public Servant. Inspector replies ‘Kya mein tumhein servant dikta hoon ?” and gives him one tight slap! Roshan slaps back and ends up getting arrested. Ali (Rishi Kapoor) comes to his rescue and gets him out by bribing the inspector. Rumours start spreading about mysterious Monkey Man with several people claiming to have seen it creating menace. The local TV channels keep telecasting the Monkey Man stories.

The first half is really enjoyable and I would rate it 4/5.


Second Half –                                                

     Roshan falls in trouble with one of the episodes of monkey man. He decides to go back to America, but finds out that something is stopping him. He realizes that he has fallen in love with Bittu. Meanwhile riots breaks out between Hindus and Muslims over the issue of Monkey Man. Thereafter the movie completely loses the plot. Sigh! It was sort of torture to watch the second half. I would rate it -1 / 5. (Minus one on Five)


    The best aspect of the movie is its Music. Nice work  by Rahaman. Also the bylanes of Chandi Chowk are shot nicely. Sonam Kapoor is decent. So if you want to enjoy the movie, then watch it till the intermission. That’s my advice. The movie is nowhere near RDB.


Image courtesy :

Will a bailout help US Automakers ?


Since past few weeks, the Detroit’s Big 3 are pleading with congress for a bailout . But will a bailout really help an ailing automotive industry? The US govt. is skeptical. With falling sales month on month, and with the US economy in recession for almost a year now, US automotive industry is going through a tough time.


Where did the US automakers fail? There seems to be several reasons. First and foremost GM, Ford and Chrysler did huge investment in producing SUV and likes, which consumes fuel in larger quantities. When the oil prices shot up, naturally the demand for SUV’s were down. Consumers started buying more and more fuel efficient vehicles, and the Big 3 failed to respond to this. Meanwhile Japanese and German automakers entered the market with compact fuel efficient cars and US automakers failed to compete. Also US automakers couldn’t match the quality of Japanese and German cars, and this further led the consumers drift away from the domestic carmakers.


Another important factor is labour cost. US automakers have their plant located in places where labour costs are pretty high as compared to their foreign counterparts. And on top of it GM still pays for the health care costs of its retired workers, which is bigger than its current workforce. Coupled with it the strict labor laws are definite drawbacks. All these started eating into the profits of GM.


Will a bailout solve the problem? Looking at the above factors, a bailout will only give a temporary solution. It can only delay the fall. So the best option would be to file for bankruptcy, restructure and invest more in producing fuel efficient cars. Listen to the market and invest more in producing electric, hybrid cars.


Photo courtesy :

5 in 1!

I am back to blogging after a short break. There were several topics on which I intended to write, but couldn’t due to lack of time or interest. In this post I have compiled my reviews/opinions about a few movies which I watched in the recent past.


The Dark Knight

A blockbuster of this year. The sequel to Batman begins, went on breaking a few records in terms of box office collections. The highlight of the movie is the Psycho villain, Joker played by Heath Ledger. The Joker was so impressive that I could see quite a few friends updating to his pics in their social networking sites, frequently using the phrase “Why so serious?” etc etc. The movie is not a typical superhero movie type, where the superhero emerges out of no where and saves the people. Here the focus is on the mind games played by the Joker and the Batman! Complicated huh! The movie has some very good action scenes, especially the one in which the Batman uses Batpod. The movie runs very fast and I had to watch it twice to get the flow J . The back ground music when the joker emerges was quite irritating I must say. But it was adding to the effect. I would give it a rating of 3.5 out of 5.


Bachna Ae Haseeno

This is the second movie of Ranbir Kapoor, a new found Hero of Bollywood. After hopelessly failing to impress audience in his first movie, RK is back on the screen romancing three hotties this time. In the movie RK is a flirt who is interested only in Live in relationships. When the topic of marriage comes, he runs off. In the process he breaks hearts of Minissha Lamba and Bipasha Basu. Later he falls in true love with Deepika Padukone and when she rejects him, he realizes the similar mistakes he has done with other girls. Now his journey for repentance starts. I must admit that Deepika looks awesome in the movie. So if not for anything, it’s worth watching the movie for her. I would rate the movie 2.5 + 0.5 (for Deepika) out of 5.



  A Wednesday

This one is a suspense thriller. A new genre of movies of Bollywood which does not cast a conventional Hero, Heroine nor includes any songs. I guess this should be a relief for people who are fed up of Bollywood prototype movies. The movie has Anupam Kher and Naseeruddin Shah in lead roles and runs for 90 minutes. I am not going to reveal any story because this movie is worth watching atleast once. And trust me this movie has got one of the best endings! This movie reminded me of ‘Amir’, which too is of similar types.

I would rate it 4 on 5.



Rock On

After reading numerous positive reviews about the movie, naturally my expections were quite high. But I was disappointed. I guess the movie has got more hype than what it actually deserved. The story is that of four friends who form a band called ‘Magik’. Arjun Rampal and Farhan Akhtar are in lead roles. The magik group strives hard to make it big and in the process ego clashes comes up between Arjun Rampal and Farhan Akhtar. The group splits and 4 friends get busy in their own lives. After about 10 years, Farhan’s wife Prachi Desai learns about the band and tries to re unite them. That’s all. I would rate the movie 3 out of 5.



Jaane Tu Ya Jaane Na

This one is my favourite of the lots. And the best I have watched this year. The debutant Imran Khan and Telugu actress Genelia D’Souza have done excellent job. The movie is that of a group of college friends. Jai (Imran Khan) and Aditi (Genelia) are very close friends, but everyone else expects they are in love. After graduation Aditi’s parents ask Jai to marry her. But both Jai and Adiit get shocked and clarify that they are not in love and are just good friends. Then a new girl enters Jai’s life. Slowly Aditi feels left out. A new guy enters Aditi’s life. Finally both realize that they cant live without each other. The movie also includes Arbaaz Khan, Sohail Khan, Naseeruddin Shah in comic roles. I would rate it 4 on 5.


Indian woman.. Changes and Challenges!


Disclaimer : This article is written by one of my friends, who wishes to remain anonymous.


The  word  ‘prayer’  is what  sums  up  a  life  lead  well  and  truthfully,  is  what  I  feel.  Just  let  it  be  one  of  silent  and  humble  devotion. The  only true  way  that my  religion  requires  for   salvation,  freedom,  nirvana  or  mukti  or  whatever  you  may  call  it, is  to  free   oneself  of  desires  and  possessions.


  When  you  pray  and  you  truly  pray,  not  the  usual  standing  before  god  and  begging  for  all   material  things  instead  of  worshipping,  will  you  find  that  freedom.


I  look  upon  a  true  Hindu  woman  and   her  life  as  a  personification  of  the  word  prayer  or   a  better ‘Aradhana’ ,  as  in  Sanskrit.  She  literally  gives  her  entire  life  in  all   of  hers, as  a  mother, sister,  daughter  and  beloved  wife  for  the  happiness  and  comforts  of  the  ones  she  loves.  not  a  single  demand  for  herself,  even  when  she  is  selfish,  it  is  for  someone  who  she  loves  and  not  for  her  own.  That  is  the  the  ideal  of  Hinduism  in  all its   hidden   glory,  giving  up  our  egos  and  comforts  for  others.  


And  yet  these  hundreds  of  years  of  selfless  sacrifice  have  brought  our  race  to  nothing  but  to  look   upon  women  as  something  of   a  commodity,  a  possession.  She  is  a  thing  and  not  a  sentient  being,  who  is  to  work  ceaselessly  for  the  comfort  of  man.  she  is  not to  have  a say  in  her  life,  all of  her  life.


Most  males  and  Indians  are  no  exception,  rather  more  aggressive  in  this  respect,  suffer  from  a  false  sense  of  mastership.  they  have  over  generations  come  to  believe  that  women  are  created  to  serve  and  please  them  only.  We  comfortably  forget  that  our  mothers, sister,  wives  and  daughters  do  not  obey  or  follow  us  only  because  of  our  ‘Manliness’  alone.  They  do  it  more  so  because  of  the  love  they  possess,  for  which  they  are  ready  to  vanquish  their  egos  and  themselves  too.  May be  it  is  selfless  or  selfish,  but  that  is  the   case  in  most  instances.


However  these   long  times   of  servile  love  has  imbued  both  men  and  women  with  decadence. Much  as  men  can’t  handle  strong  and  independent  women,  the  fairer  sex  has  also  learnt  to  forgo  correct  and  right  things  for  the  sake  of  ‘Family’ as  well  as  their  own  selfish  nature;  the  latter  being  a  by-product  of   sense  of  self  preservation.  And  each  successive  generation  of  parents  and  teachers  have  only  reinforced  these  beliefs  in  the  coming  ones  with  their  skewed  visions  and  teachings.


The result?  We  have  a  society  where  men  are  considered  inferior  to  each  other  and  women,  to all  men; for  ‘the  hand  that   rocks  the  cradle, rules  the  world’. And  when  those  hands  themselves  are  weak,  what  do  we  expect  them  to  raise  other  than  a  race  of  bigots  and  maniacs.  Those  who  are  never  given  a  choice  in  their  lives,  what  education  and  culture  will  they  give  to  their  offspring  save  fear  and  hidden  malice  and  distrust.

And  this  has  created  a  paradox  in  recent  times  and  more  so  with  our  generation.  the   older  ones,  our  mothers  and  all   are  still   rooted  to  the  old  and  orthodox  ideas  of their  inherent  inferior  position  in  family in  family  and  society.  The  newer  generations however  fare  no  better  and  are  caught  in  a  doldrums  as  if.  Most  of  them  coming  from  ‘strict’  and  middle  class  families  when  living,  reading  and  working  in  the  home  towns  are  typically  the ‘Good  girls’.  And  these  same  women  when  away  from  families  are  easy  preys  to  a  hundred  temptations,  waiting   to  beguile  and   destroy  them.


  And  famished   as  they  are,  for  the  simple  wants  of  freedom  to  think  and  choose,  many  cross  over  the  lines  just  trying  to  experiment  or  have  fun.  the   simplest   evidence  to  illustrate  these   are  the  demographical  data  which  clearly  show  the  rise  of  smoking  and  drinking  among  women,  not  only  in  big  metros  but  all  over  the  nation.  These  two  vices  earlier  considered   the  supreme  taboo  are  now  termed  as  casual  and  cool.  And   these   are  eating  into  the  very  roots  of  our  culture  and  civilization  as  Hindus  and  Indians   as   well.  Various  social   magazines  proudly   carry   out    sex   surveys  that  celebrate  ‘the  coming  of  age   of  the  Indian  women’  .  Replete  with  lurid   articles   on  the  ever  increasing  promiscuity  in  our   country  and  new  ‘brave’  concepts  as ‘Live-in  relations’ ,  where  both  men  and  women  are  reduced  to  the  state  of  mere  concubines  or   as  in  Hindi  the  word ‘Rakhail’  I  do   not  know  what   they  are   trying  to  prove. The  popular  modes  of  entertainment  viz.  television  and  cinema  seem  to  harp  on  the  axes  premarital  and  post marital  relationships  and  other  such  misguided  openness. And  the  phenomenon  are  no  longer  confined  to  large  cities  and  metros,  but  also common in  the  smaller  towns.


A  question however  arises. Are women only to be blamed for this condition? To   a   large  extent  we  may  use  the  doctrine  of  self responsibility  and  other  such  things  but  everyone  knows  the  adage  “You  need  two  hands  to  clap.” So  the  society  must  accept  the  other  half  of  the  responsibility.  A  horse  if  kept  in  confinement   for  long,  will  naturally  hesitate  to  walk   into  a  open  space  even  if  left  free. Yet  after  a  few  half  hearted  canters, it  will  run  in  every  direction  without  knowing  where  to  go. Too  thirsty  a  man  drinks  water  in  large   gulps  not  caring  about  the  taste  and  quality. Therefore,  it  is  quite  natural that  our  womenfolk  the  modern, educated  and  self  reliant,  but  away  from  the  family  are  prone  to  practises  which  are  physically  and  emotionally  destructive.


All   of   this  raises  a  need   for  a  solution  if  there  is  one.  Is  it ?   I  think  there  is.  however  it  will  take  some  time.  When   a   river  breaks  a  dam,  the  first  rush  always  brings  the  filth  and  silt  which  has   been  collecting  against  the  wall  for  so  many  years.  Similarily,  this  ongoing  upheaval   and  change  in  the  women  around  us  is  but  normal  sign  of  the  process  in  motion.  This  eruption  of  so  called  ‘repressed   sexuality’  and  other  forms  of  femine  transformations,  both  good  and  bad.  However  as  the  flow  come  to  a  normal  level  in  due  course  of  time,  the  river  will  become  life   giving  once  more.


It  is  our  collective  responsibility  to  understand  and  assimilate  the  good  things  that  have  come  from  these transformation.  All  of  us  the  parents,  teachers,  friends, colleagues  and  most  of  all, each  individual  especially  the  modern  Indian  women  must  understand  their  rights  and  roles.  Theirs  is  a  delicate  and  very  important  role  in  our  culture.  they  must  learn  to  get  their  rights  as  responsible  adults  and  do  their  rightful  duties.


We  want  to  go  back  to  the  days   of  Savitri   the  ever  pure  and  ever  free,  who  chose  her  own  husband  fully  knowing  the  consequences. Let  the  daughter  of  Modern  India  be  once  more Rani ahalya bai, Jhansi Rani  Laxmibai  and  virago  chennama  of  Kittur.  The  age  old  gender  bias  and  the  religious  narrow-mindedness  are  sending  us  back  to  the  medival  ages.  We  need  to  turn  back  and  move  ahead.


the  only   thing  neede  is  to   provide  right  example  before  our  children  and  everyone  else  and  believing  in  the  choices  they  make.


We  need   to  be   their  guides  and  not  their  masters.And  then  only  once  more   the  pious  motherland  of  ours  reverberate  with  the  chants  of


"Yatra  naari  pujyante,  ramanti  tatra  deavata"


Verily  the  gods  reside,  where  the  women  are  worshipped..



Thanks  for  your  time  and  patience           

The Alchemist

When you want something, all the universe conspires in helping you to achieve it


     This is one of my favourite quotes from the book. The alchemist is a novel by Brazilian author Paulo Coelho. The book is about chasing dreams and realizing them. It was a nice read. The book evokes a sort of positive feeling and guides how one should realize his dream. This is narrated using a story of a Shepherd boy, Santiago, who undertakes a journey to pyramids in order to realize his dream.


     The book speaks about ‘Omens’ throughout which are the gestures of God. When one is on the path of realizing his dream, God helps him by showing signs. Santiago reads these omens, such as rolling out of the stones Urim and Thummin from his pocket when he was robbed and left moneyless, in desert he studies the flight of the hawks and infers about the threat in the future. ‘The Language of the world’ is something which the book refers very often. It is the language which the world speaks. It is the language the sheep speaks to look for food and water; the Camels speak to the desert and so on. Every object in this world communicates using this language.


     The principles of Alchemy come somewhere in the middle of the book. In the mid way through his jouerny, boy meets Alchemist who guides him for the remaining of the journey. The book also refers to ‘The philosopher’s stone’ which transforms any metal into gold and ‘The Elixir of life’ which can cure any illness. Alchemists posses these.


     The book is written using a simple language. But i did find some philosophical parts hard to understand. I am considering reading the book a second time to get some more insights. If not anyone, at least Paulo Coelho has realized his dream by writing this book!


Maktub !  


Why do u kill the already dead?


I want to ask the above question to the newspaper and television media. The recent episode of death of Padmapriya, the wife of udupi MLA Raghupati Bhat is depicted by the media in a very poor light. First it was announced that she is kidnapped. Then they told that the police tracked her in Kolar, which God knows whether was true. Later she was found dead in an apartment in Delhi. She was also shown having relationship with Atul, a childhood friend of Raghupati Bhat. The media sells a new story everyday and the issue is blown out of proportion. I really doubt whether all the news related to the incident has any proof.  

Similar was the case of Arushi’s murder. Initially servant Hemraj was the suspect who was found dead the next day. There were even reports that the 14 year old girl had relationship with the 35+ year old servant, which I believe is utter nonsense. Next day, her father was arrested, with charges of dual murder. I again don’t understand how a father can kill his own daughter.


Our police dept. has done a splendid job in the above two cases. They were clueless since day one, and are acting as if culprits themselves should come and surrender. If any dept. is in need of training, then our police dept. stands first. They are always known for their heroic acts of punishing the innocent and let go of the criminals. Just like shown in movies, they always reach the crime spot at the end.


Our beloved Ekta kapoor is not far behind. To add fuel to the fire, she has brought in Arushi’s case in her daily soaps. This is something totally unacceptable. Please don’t promote the mockery of the deceased. I want to ask these people, ‘Why do u kill the already dead?’


(Photo courtesy:,

Ana Ivanovic wins her first Grand Slam Title!


      I would be glad to see the above headines in newspapers tomorrow. The Serbian babe has very good chances of winning the French Open title today. A year back, she had raised eyebrows by reaching finals of French Open, but eventually lost to Henin. And now Henin is retired, and other strong opponent Sharapova is out, chances are bright for Ana to clinch the title.   

    Ana Ivanovic, 20, is a rare combination of beauty and talent. It’s a treat to watch her on court. She displayed splendid performance in Australian Open this year reaching the grand slam finals, where she lost to Sharapova. Hope todays match fetches Ana her first Grand Slam title. All the best Ana!    

(Photo Courtesy : )

Update : Ana wins French Open. Yayy 🙂 . Congrats Ana! You deserved this victory.