Category Archives: #switch

Wake Computer From Sleep WIFI Button


I’ve always setup my computer to be woken up from sleep via an app on my phone (Wol Wake on Lan Wan by Brobble, for anyone interested). But yesterday, I thought, I should just make a button that sits on my couch side table … that’s really where this button should be.
I use my computer as a media manager (using Plex, another app, to manage and stream to my smart TV). As I was thinking out loud that I wanted such an “Easy” button … I realized that I already had all the parts needed to make this happen.

Arduino GSM Expandable Vehicle Connection Project


Working on some code today. I discovered the many awesome uses of switch(x){Case(0):} loops in the Arduino code. Here’s how they work:

if (buttons & BUTTON_UP) {                       // If a button is pressed and it is the Up button
          menu = menu – 1;                                 // Adjust the menu item to be the one before
          if (menu<0) menu=3;                            // If you went too far up, cycle through to the bottom
          switch(menu){                                      // Start the switch loop using the “menu” variable
            case 0:                                               // In case the menu = 0
              lcd.setCursor(0,1);                           // Place the LCD cursor at the bottom left
              lcd.print(“1-ChangeSensTrip”);         // Print “1-ChangeSensTrip” on the LCD
              break;                                              // Need this break, otherwise it will continue
            case 1:
              lcd.setCursor(0,1);
              lcd.print(“2)ShowSensorVals”);
              break;
          }
}

Here’s my code on Github if you would like to use it: https://github.com/Phoenix260/Capacitive_Sensor And don’t forget the licence agreement. Personal use only!

I’ll clean it up when I have time.

Enjoy.