I snapped our lawnmower cord. Oh snap.
As it happens, I can fix anything. Without exception.

Hit the fold for details, four action pics, and a video.
Last week found me standing tall upon my shell script soapbox, shouting command line praises to all who would listen.
Thou ought direct thine output aftways, to-wards thine USB port of thee. And that is well and righteous.
Well, that still is the case. My latest project has made it glaringly obvious that sometimes a little Python script will render a whole bunch of shell scripting moot. Namely, parsing HTML. Let’s see a picture…
Lunch hour project: parse the comments from swantron.com; feed said comments to an LCD screen.
I was horsing around with wget from a CLI a few days ago. I found myself trying to smash through the resultant file via pure regular expressions…which is incredibly clumsy. Well, as luck would have it, my go-to after my main go-to is Python, and this type of thing has been issue enough to warrant a library. BeautifulSoup. It acts to parse the HTML info into items, that can be smashed around as I see(med) fit.
My setup was simple: py script to snag my comments and write serial, Arduino sketch to drive a LCD and read/write serial. And a source of shade. And a WiFi signal to snag.
Check, check, check, etc. Video time:
Pretty slick…hit the fold for the code, as promised, and a summary.
Continue reading “HTML to Python to Arduino to LCD”
Liquid crystal displays are pretty awesome. Command line interfaces are very awesome. Hmm…
I started daydreaming at work about how to go about making hardware interface with an RSS feed. I have seen some projects that use Arduinos with ethernet shields to check Twitter, for example, but they seem unnecessarily bulky. Or clumsy. I spend a lot of time working on the command line, and love to put together dirty little scripts to solve problems. It sort of goes along the lines of ‘when you have a hammer, everything looks like a nail’…I figured that the same thing could be implemented with a little shell scripting and my trusty Arduino, sans anything complicated.
So far, so good.
I put together a sketch (after the bump) to drive my LCD, writing serial output to the screen. After verifying that the sketch worked via the Arduino IDE’s serial monitor, I popped open a CLI and got to work. FWIW, I am using Ubuntu 11.04 still…ctrl-alt-t pops open a terminal window…unity has me all over shortcuts these days. Anyhow, I was able to verify that I could echo text and direct it to the USB port that the Arduino was mounted to. No sweat.
As a proof of concept, I decided to display the number of times that I had the word “awesome” on swantron.com. Once the LCD was shown to work, the sky is the limit…see some regex, pipes, wget, and so forth in action:
Survey says:
Eleven “awesome”s. Awesome.
(Hit the bump for some code, an oddity, and more fun…)
Continue reading “Command Line LCD Arduino Interface”
The internets have been abuzz with talk of further stifling of Android tethering. Regardless of what will come of this, I would recommend getting a setup in place. May as well…you paid for the device. Am I right?
My breaking point came with continued poor results from the wireless connection at work. Enough was enough. After trying several mean with which to tether, I think I have found one that is suitable for my needs.
My hardware is simple…mid-line Dell Studio Notebook running Ubuntu 11.04…Droid 2, rooted, running Fro-Yo. Verizon with data plan…unlimited, if that is still the case. Connection…check
I played around with several apps, but have found that Barnacle Wifi Tether from the Android Market does the trick quite nicely. I have dumped several gigs through 3G, and it is decently fast. Haven’t had to reboot, or do anything wonky to this point. I have had two clients connected simultaneously, and it seems to be chugging along. You must configure the security settings, as this puppy lets it rip wide open out of the box.
Grab the app from the Market before Google folds to Verizon. If you need any help rooting your phone, holler at me as well.
Ladder safety is a must in my book. Before tackling that weekend project around the house, take a look at these ladder tips I have collected.
* Ensure the roof of the vehicle you are using is obstruction free
* Make sure the ladder is fully opened, with both supports extended to their maximums
* Look for and remove any dangerous/pointy objects from around the vehicle
* Take note of any overhead power lines and or cables
Here, I have safely used a ladder to open this second-story window that had been painted shut. Safely used a ladder like a baller.
Spoiler1: This is awesome.
Spoiler2: I’ve never seen Minority Report.
I do know that there is some sort of hands free interface, and that is what I have put together.
Long story short, I have extended upon my PING))) project to include some sweet touchless home automation. I have the ultrasonic sensor interfacing with my garage door and a lamp, utilizing a servo and a PowerSwitch Tail, respectively.
Hit the bump for an awesome video of this thing in action, and for my spippet.
Before you try to dr this, I have included a video to combat the tl crowd. You’re quite welcome. See below.
Now I’ll explain. I may even toss in a snippet…who knows.
Basically, I found myself with a few free hours, an Arduino, a bunch of random components in my lab (read: garage) at my disposal, and no real plan of attack. Result? Arduino/servo motor controlled fan.
Jump off component…silver spray painted Altoids can. Nice…chop that sucker up so I can smash a servo motor in there.
Lady Ada uses these for some random projects. If you can stomach a whole bunch of crappy mints, you have a nice little Arduino-sized metal casing. Of course, it poses a grounding threat, which I experienced working with my motor shield a while back. That said…keep a few around. I have put this one to use before.
Next step…testing the servo
For this, I broke out my motor shield. It doesn’t have any features that would benefit this project…the servo areas are basically just power, ground, and control. Control pumps into the 16B 10 port, like a jumper…that works for my debug.
Next, implement a fan.
I snagged this fan from an old tower, I think. I really don’t know. It seemed to react well to a 9V battery, so I tried it with a 5V source…same deal. Awesome. I used a zip tie to fasten this to that, that being the Altoids enclosure.
This thing needs a base…man-clamp to the rescue:
I picked this up, to use it as a soldering base. That ‘x-tra’ hands piece of shit that I have previously posted in pictures didn’t cut it. This is the manly version. And, it works great for this project, I believe…you can decide based upon the vid. Here is what it looks like, with some more detail.
Let’s add some code…oh no…sounds like we’ve reached the BALLIN ASS SNIPPET ZONE
#include
Servo myservo; // servo opbect
int pos = 0; // initialize
void setup()
{
myservo.attach(10); // digi pin 10void loop()
{
for(pos = 0; pos < 180; pos += 1) // from 1 to 180 { myservo.write(pos); // moves servo delay(20); // waits 20 ms } for(pos = 180; pos>=1; pos-=1) // sweeps span between 180 and 1
{
myservo.write(pos); // moves servo
delay(20); // waits 20 ms
}
}
If that looks familiar, it is because it pretty much the sweep example from the Arduino IDE. No changes necessary…I like when that happens.
Here is the final product:
Not bad, for a quick slam-together exercise. It isn’t really robotic, since it has no sensors. I could bump this up a notch with some IR LEDs, or my PIR sensor, but that is for another time.
Blah blah blah, stay tuned, blah blah. Until then.
Katie’s flat iron failed…TO THE RESCUE!
Pull that sucker apart…
Burn mark…oh snaps…TO THE LAB!
Blown switch…NOW WHAT!
I’m going to try to bypass the switch, as it only functions to toggle a LED. Maybe I will find a switch that will fit the board…I have enough crap laying around this joint.
Some time ago, I snagged a robotics kit from Amazon. A few weeks after said time, I assembled the mechanical components of said kit. I assumed that the electrical assembly would be equally as detail-centric. I was quite wrong.
It was a son-of-a-bitch. Plus, I had a snaffu with the IR emitters, which are more than likely the same price as the microcontroller that is involved with this kit. Good President’s Day? You better believe it…so much fun horsing around with new connections, crappy directions, and a semi-success. Off to The Shack (Radio Shack’s awesome new advert front) to complete the project tomorrow at lunch, if all goes well. My motors are working, and all three emitters are pushing power, which indicates a solid-ass project as far as connectivity is concerned. Close, but no cigar. Maybe I’ll show off that cigar tomorrow.
Good news…you don’t have to listen to me blather on. At least blather on too much…there will be some blathering.
I mentioned a few posts ago that I was feeling lousy about failing to post some junk. Junk and stuff…electronics…programming is uber-super…blathering again…et…cet…etcetera.