posts tagged with the keyword ‘pcomp’

2016.12.08

Colors

One of my PCOMP students wants to randomly select a set of RGB values from a predetermined list. It’s the sort of things where I know the concept is easy but the execution is a bit more difficult only because I’ve done it in other languages/environments, but not in an Arduino sketch.

The nice thing about programming is that once you know how to do something using one language, the concepts transfer over to other languages, and it becomes mostly a matter of figuring out the syntax and method to make it all work.

Here’s an example sketch that allows you to have a list (array) of RGB values and then randomly select one and return it, split the r, g, b into their own integer variables, and then print them to the serial monitor. (The final version will use analogWrite to control RGB LEDs.)

// RandomColor.ino

void setup() {
  Serial.begin(9600);
  randomSeed(analogRead(A0));
}

void loop() {
  char* rgb = returnColors();
  int r, g, b;
  if (sscanf(rgb, "%d,%d,%d", &r, &g, &b) == 3) {
    Serial.print(r);
    Serial.print(", ");
    Serial.print(g);
    Serial.print(", ");
    Serial.println(b);
  }
  delay(500);
}

char* returnColors() {
  char* myColors[6];
  myColors[0] = "128,0,0";
  myColors[1] = "0,128,0";
  myColors[2] = "0,0,128";
  myColors[3] = "255,0,0";
  myColors[4] = "0,255,0";
  myColors[5] = "0,0,255";
  int colorIndex = random(0,6);
  char* result = myColors[colorIndex];
  return (result);
}

Obviously the list can be much larger than just six elements, but this is example code to be expanded upon.

You can also grab this code from github.

Update: Royce has his own version you can check out. He suggests it should be more efficient because the textual RGB values are converted to binary at compile time rather than runtime.

2016.11.05

Cameron

Alex

Katrina

Maks

Megan

Sadie

Stefanie

Sarah

Malcolm

Raven

Ali

Chance

We’re already half way through the semester and finished our third assignment for Electronics and Sculpture last week. Assignment 3 requires analog input and output for the project. (Assignment 1 is purely digital, and Assignment 2 requires analog input for control.) And yes, the class is called “Electronics and Sculpture” but it could just as easily be named “Arduino for Artists”.

Projects have varied from very interactive to installations to mostly sculptural with some electronics added in. I find that students do the best work when they can take what they are learning in class and combine it with their own practice, or what they are learning in other classes. The Digital Fabrication students definitely have an advantage here, and I wish all of the students had access to digital fabrication tools, though we just wouldn’t have time to cover it all in the 318 class. (That’s not to say the work of non-Digital Fabrication students is lacking in any way, and I’ve seen some great work using very simple material and tools. As always, art is a combination of things, including concepts, themes, ideas, technical skills and abilities, and more.)

We’re currently in the middle of the midterm project, and things are coming together quite well. Critique is in two weeks, and after that we launch right into the final project. (Since there isn’t an Arts+Tech Night this semester, we’ll probably just push the final critique onto the date that our final exam is scheduled for.)

2016.06.05

Mike's Light Sculpture

The Electronics and Sculpture class I taught this semester wrapped up a few weeks ago and my students showed their final projects at Arts+Tech Night in May. I’ve included a few photos in this post, but each student also posted their project online, so check below for more links.

Lionel's Brick

The class was structured around five projects in total, with three being smaller projects focusing on digital input/output, analog sensors controlling 2-3 digital things, and the third using analog input/output. The last two projects were larger, one being the mid-term project and the other being the final project, which was then shown to the public during Arts+Tech Night, and treated as an installation for the event.

Greg's Drumming Machine

The books we used for the course were Make: Electronics: Learning Through Discovery by Charles Platt and Programming Arduino Getting Started with Sketches by Simon Monk. I think the amount of reading was fairly minimal, but needed up front for a lot of the things we did later in the semester.

William's Ugly Box

Much of the first half of the semester was spent going through some of the basics of electrical circuits and getting up to speed with the Arduino, learning how to wire things up, write code, and use libraries. Some students had never written code before, while others had never really built physical things before. Some students were more versed in the digital arts while others were more skilled in creating sculptural things. Students who had access to the DCRL had an advantage due to the tools and equipment they had access to (and the fact that they studied with Frankie.)

Matt's Controller

As part of the class, each student had to post their work on a public web site. Some students had blogs or portfolio sites, and some created new sites. Here’s the list of students and their web sites:

Not every student managed to write up their project, which caused me much sadness, but many did a great job of documenting their work and process.

Alycia's Kiosk

I’ll be teaching Electronics and Sculpture 318 and 418 again in the fall, and it looks like 6 of my 318 students are returning for 418 (the advanced class) so I can’t wait to see what they come up with next time!

2016.05.15

Arts+Tech Night

I mentioned back in February that I’ve been teaching a Physical Computing class at UWM called “Electronics and Sculpture” this semester. So I’ve basically been showing students how to integrate microcontrollers into their artwork. (Arduino is the order of the day, though I’ve got one student exploring ATtiny85 chips.)

Students have been working on their final projects, using techniques they’ve learned all semester, and they’ll have their work on display for the public at Arts+Tech Night happening 6pm-9pm, Wednesday, May 18th, 2016. Come on down and check it out. Most of my students will be on the 4th floor in the center area. (Maybe your friends are already going!)

mike-light

(There is a web site for ATN but sadly, despite my best efforts, It has not been updated this time around.)

2016.04.18

Hot Dog on a Spring on a Motor

It’s been a lot of fun teaching Electronics and Sculpture, and weird things happen sometimes, so I thought I’d take the time to explain a weird thing, and how it happened. The photo above is a kinetic sculpture titled “Hot Dog on a Spring on a Motor”.

Steak Ballet

The photo above is a kinetic sculpture titled “Steak Ballet”. It was created by Atticus, one of the students in the class. When you open the box, the steak (not a real stake) spins around. It’s like a music box, without music, and with meat. (But not real meat.)

During critique we started coming up with a few crazy ideas, and someone, I don’t know if it was me, or if it was Mike, came up with idea of a hot dog, on a spring, that spins around. I honestly can’t remember if one person came up with it, or it was collaborative, but it became a running joke during critique… and in a few classes afterwards.

Hot Dog on a Spring on a Motor

Steak Ballet was the third project of the semester. By the fourth project (the mid-term) the hot dog on a spring thing was sort of a regular joke. The mid-term projects were awesome, and I was really proud of the work my students did, so I decided to reward them by building something and showing it to them… thus “Hot Dog on a Spring on a Motor” was born. And I gave credit to the class on the bottom of the piece.

Hot Dog on a Spring on a Motor

Now, this also all came together for another weird reason… Joe at BBCM brought a bunch of hot dogs into my office and I asked if I could borrow one. Also, Joe knows Atticus and they used to work together. Weird!

And yes, this does continue some of the ideas I was playing with when I created the Pizza Bagel Bot for a robot battle last year.

Hot Dog on a Spring on a Motor

Here’s a quick (poor quality) video of the Hot Dog on a Spring on a Motor. (At least it’s not a Vertical Video!)

« Older Entries |


buy the button:

Buy The Button