Things used in this project

Schematics

ProMicro
Sparkfun 8-bit 32U4-based board

Code

Arduino ProMicro SketchC/C++
This is for a Sparkfun ProMicro or Arduino Micro using the 32U4 microcontroller. If another 8-bit AVR is used, please note you will need to change serial1 to serial.
Streaming library is available here: http://arduiniana.org/libraries/streaming/
/* Pro Micro Test Code
*/

  #include <Streaming.h>

  const byte  bootPin = 9;
  void setup()
  {
  pinMode(bootPin, INPUT);
  digitalWrite(bootPin, HIGH);    // enable pullup
  Serial1.begin(115200);          // This pipes to the serial TxRx
  Serial.begin(9600);             // USB serial, BAUD is just a placeholder
  Serial << "Initializing...\n\r";

  }

  void loop()
  {
  if (! digitalRead(bootPin)) {
    Serial1 << "\n\r";
    Serial << "\n\r";
    delay(1000);
    Serial << "Attempting to login as user Pi";
    Serial1 << "pi\n\r";
    delay(1000);
    Serial1 << "raspberry\n\r";
    delay(1000);
    Serial << "Attempting to write cache to SD\n\r";
    Serial1 << "sudo sync\n\r";
    delay(1000);
    Serial1 << "sudo sync\n\r";
    delay(1000);
    Serial << "Issuing the sudo reboot now command\n\r";
    Serial1 << "sudo reboot now\n\r";
    }
  }

Credits

Coffeemath
Ray Burnette
57 projects • 358 followers
IT architect - retired AT&T... USAF-Secure Comm , Burroughs, Clemson U. School of EE Research, Southern Bell, BellSouth, SofKinetics, Inc. (President), AT&T IT
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog