Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

01 – Keyboard Hack

1. November 2011

Group Eddi Lecesne / Fabian Troxler / Mike Zimmermann Idea For the keyboard hack we created a connection between the Pencil and Sharpener. Once the pencil is sharp enough the contact is made and Processing give the user feedback that the Pencil is sharp! Processing code:
int groesse = 0;
boolean gedrueckt = false;

PShape pfeil;
PShape kreuz;

void setup ()
{
  pfeil = loadShape("pfeil.svg");
  kreuz = loadShape("kreuz.svg");
  size(500,500);
  background(0);
}

void draw()
{
   if(gedrueckt == true)
  {
    background(0);
    //text("Bleistift spitz", 30, 200);
    smooth();
    fill(255,255,255);
    shape(pfeil, 0, 0, 500, 500);
  }
  else
  {
    background(0);
    // text("Bleistift nicht spitz", 30, 200);
     smooth();
    fill(255,255,255);
    shape(kreuz, 0, 0, 500, 500);
  }

}

void keyPressed()
{
   switch(key)
  {
    case '1':
    gedrueckt=true;
    break;
    case '2':
    fill(0,255,0);
    rect(250,250,20,20);
    break;
  }
}

void keyReleased()
{
  gedrueckt = false;
  // 11groesse = 0;
  //background (0);
}