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

At Long Last!

Source: Dafne Cholet This Sunday I did... nothing in particular. It was just a normal Sunday. Finally. In practice, it was actually pretty similar to the first week of the blog; I had a bunch of math homework to do. But having the choice to do something else made a huge difference. That's not to say that every Sunday this semester has been bad; in fact, many were far from it. Those days when I simply consumed media, whether it be through reading, watching a movie, or playing a video game were enjoyable enough, for at least most of the day. And some Sundays were downright productive; the day when I did nothing but homework genuinely gave me a head start on Physics 213. But I think the most fun (and occasionally the most painful) days were the weird ones. Standing, playing French horn (though that one wasn't quite a day), writing, coding, lacking sleep. They were all new, and that made them interesting. Until now, I wasn't entirely sure why I did this. Why spend

10 Hours of Homework; or, 5 Hours of Learning

I suppose I should start by explaining what this blog even is. I like to think of myself as a relatively productive person. Despite this, I recently noticed that, with amazing consistency, I spent my Sundays lazing around in my dorm room, doing absolutely nothing of substance. This blog is my little experiment into changing that. Every Sunday of this semester, I am going to do one thing, and only one thing, for the entire day. Other than reasonable breaks for meals and hygiene, I will spend every free moment of my day (totaling about 10 hours on a typical Sunday) devoted to that one thing. I’ll start the semester with activities that one might realistically do for an entire day, like doing homework or watching a TV show, and explore stranger and stranger possibilities as the semester continues. My goal is to document the effects that these activities have on my mental, and in some cases physical, state, providing for you content that is both humorous and interesting. And hey,