Arduino Switch Case Example


Example 1: swich case arduino

// Arduino => c++ switch (var) {   case 1:     //do something when var equals 1     break;   case 2:     //do something when var equals 2     break;   default:     // if nothing else matches, do the default     // default is optional     break; }

Example 2: arduino switch case

switch (var) {   case label1:     // statements     break;   case label2:     // statements     break;   default:     // statements     break; }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable