I've got around a eight-minute walk to my closest train station every morning. Depending on how late I'm running, that time can swing to eight minutes if I really pick up the pace to around twelve if I mosey. It seems like when I try to do the eight-minute run, I always end up getting to the station right as my train is pulling away. To help better predict how much time I have to catch a train, I made a button that can figure out when the next train arrives and then texts me the time.
Step 1 - How to Make the Button
Step 2 - Set Up Your Edison
Full disclosure, I'm working on a Mac, so these instructions will skew that way. To get started, you should have a freshly-flashed Edison. After you board is flashed, you can try to find the IP address and enter all the additional commands, or you can just "npm install bloop" on the machine that you're trying to SSH in from. Bloop is a tool from Rex St. John, and it's an absolute lifesaver when you're working with the Edison. Instead of running "screen /dev/cu.usbserial-XXXXX 115200 -L", all you have to do is run "bloop c" in terminal and it will connect to the Edison it finds on your network. Once you're in, run "configure_edison --setup" to get your wi-fi and user creds defined.
While all this is happening, you can start downloading the Edison Yocto Image from this site. You want the link that says, "Edison Yocto complete image." Once downloaded, you'll need to load the files onto a micro SD card - you can read up on Yocto and how to get those files onto the SD card here. After you load the files, power down your Edison, insert the SD card, and the power it back up. To test your install is working, SSH into your Edison and type "node -v". If that returns the version of Node that you have installed you're good to go. If it says "Command not found," you're going to need to try loading Yocto onto the SD card again, because something went wrong.
Step 3 - Hook Up Your Edison
At this point in the build, you'll need to hook up whatever kind of button you're using. I was fortunate enough to receive a Grove Starter Kit from Intel, so I'll be talking about my experience with hooking that up. First pro-tip is that the connector shield is located on the back of the red anti-static foam, under the LCD screen. I may or may not have made it all the way to ordering a connector shield on Amazon before errantly knocking the starter kit case over and realizing that there was a shield already in the kit. It was early, I hadn't made coffee yet.
I 3D printed a case for my Edison using this file. The case uses the screws for the struts to secure the lid, and has two slots for the shield pins to go through. I did have to drill an extra hole in the lid for the ISP pins, but other than that everything fits great.
Attach the Grove Connector Shield to the pins on the Arduino breakout board, then grab a connector and attach your button to the pin marked "D2" (digital 2). Once that is securely connected, go ahead and power up your Edison.
It should be noted that while the Grove Starter Kit is a nice to have, you don't really need to worry about not having it. Get a button, solder some wires on, and hook it up straight to the pins on the Arduino - it's all the same thing.
Step 4 - Write Your Code
Require the libraries that we need for the sketch