Skip to main content

Ardui-No Thank You

A screenshot of the Arduino IDE


This post requires a bit of background before I jump in.

I'm in a club here at Penn State called the Student Space Program Laboratory (SSPL for short). It's pretty much what it sounds like: a space program for students at Penn State. It's most heavily targeted at aerospace engineering students, but students from other disciplines like mechanical or electrical engineering are more than welcome.

Now, I should make it clear that the club isn't launching Penn State students, or cars, or anything terribly exciting into space; it's mostly just small satellites. But, still, it's pretty darn cool to have anything in space.

But I digress. I'm not actually working on anything this semester that will be shot into space, or even attached to a rocket of an appreciable size. Instead, I'm doing the Student Training Program, or STP. New members of the club are split into groups, and each group designs a payload for a small model rocket. This payload has to measure, record, and transmit various types of data, from acceleration to UV radiation.

It's a pretty simple task, but the point of the STP is less to test ourselves and more to familiarize ourselves with the design process, workflow, and some of the hardware and software used in SSPL. This is also the stage where students determine what skills they can contribute most to SSPL with. The groups (which are usually around six people) split into three or four subgroups each, with each subgroup tackling one component of the problem: software, electronics, housing design, etc.

As it turns out, the skill of mine that is most useful to my group is my programming experience. This came as something of a surprise to me; I'm no CS major, and heck, the C++ class I'm taking this semester is the first formal programming course I've ever taken. But I used an Arduino for a high school engineering project, and that gave me more experience related to programming a flight computer than anybody else in the group.

So, that's what I did this past Sunday: program an Arduino (well, technically a SAMD 21). How was it?

Terrible.

The actual program part wasn't bad at all. All we needed to do was collect, store, and transmit the data at predetermined intervals, and that's almost trivially easy to do with the Arduino IDE. The hard part was the setup code.

See, for most of the dozen or so sensors we plan to use for our payload, some setup code is required: to turn the sensor on, to set the data collection settings, to calibrate the sensor, and so on. Usually, this is as simple as importing a library and copying and pasting some sample code. In this case, not so much.

The most frustrating problem I ran into was an issue between the SPI library (SPI is a communications interface) and the Adafruit Sensor library (Adafruit is an electronics supplier, and this library is a general-purpose library used by most of their sensors). Trying to compile the code gave an error stating that a certain function, SPI, was defined twice, once in each of these libraries.

This seemed like an easy fix: just delete the function from the Adafruit Sensor library, and the problem should be solved. But the function wasn't actually in that library, despite the compiler saying it was. It took me at least a solid half hour of frantic Googling before I realized my mistake: in another section of the code, I initialized a SERCOM (a general-purpose communications port) to use SPI communication, and I called that instance "SPI."

The day was full of little hiccups like this. And my eyes hurt aftwerwards. And, jeez, the coding was just downright boring most of the time. I definitely would not recommend doing this

Comments

  1. Ha, I am not a big fan of messing around with code and programming anything either. I built a 3D printer this semester (like way back before Christmas break) and it just now starting printing anything useful. The code was all messed up and I ran into so many hiccups. However, I'm just grateful that it's working now. As a fellow engineering, I feel your pain. It's about time to pass this part of our projects onto our fellow Comp Sci peers.

    ReplyDelete

Post a Comment

Popular posts from this blog

The Stories We Tell Ourselves

Image Source: Senor Velasco After last week's excursion, I decided to do something a little more mundane this past Sunday: watching TV. I don't exactly have access to cable television, so I decided to rewatch an old favorite of mine, Battlestar Galactica (the new series, not the one from the 1970s). Imagine my surprise when I found out that Netflix didn't have Battlestar Galactica anymore. Or Doctor Who. Or The Addams Family. Dang it. Eventually I settled on BoJack Horseman. It's a Netflix original, and my favorite TV show, and I figured I was due for a rewatch. So that's what I did all Sunday. I suppose I should explain what BoJack Horseman is. Basically, it's an animated show that exists in an alternate Hollywood where humans and anthropomorphic animals coexist (no explanation is given for this). The story follows the life of BoJack Horseman, a washed-up sitcom actor desperately clamoring for the glory days. It starts out seeming like any other subp...

Words, Words, Words

There's nothing quite like cozying up with a good book and a mug of coffee, turning on a reading lamp, and disappearing into a story. That's what I did the Sunday before last, for eight hours. It was decidedly uncozy. It should be said that there were a few circumstances that conspired to make the day a miserable experience. I was rather sleep-deprived; I'd had trouble sleeping the previous night, and I hadn't really slept well for the whole week before that, either. On top of that, I was in the middle of a nasty cold. But these things aren't usually huge problems if I'm doing what I like. And the book I chose was Foundation and Empire by Isaac Asimov, the second book in the Foundation series. I enjoyed the first one quite a bit, so I anticipated that I would like this one, as well. And, at least from the parts I can remember, it was even more enjoyable than the first book (more on that pesky "remembering" thing later). For the first few hou...

I can't stand it!

Source: Kirsti I. I was faced with a bit of a predicament this past Sunday: I had to go to Best Buy for some packaging materials. It's a solid 50 minute walk away. How would I do one thing for the entire day? And then it dawned on me: what if I just went through my day like I otherwise would, except I never sat down? So, I spent the entire day standing. My morning was mostly usual: I woke up, did some laundry, and cleaned up my room. All stuff I usually do on my feet anyway. I got a sub for lunch, and ate it in my room as I checked the day's news. It was kind of strange eating standing up, having to move the sub so far from the plate to my face, but other than that, it was pretty much like any other Sunday. Then, in the afternoon, I walked to Best Buy. Now, if you're ever going to walk somewhere 50 minutes away, the one thing you should do beforehand is check the weather. It had already started snowing when I left my dorm. I took Allen Street out to North Ather...