17 April 2022

Journey Controller (Hongxu Li)

 Picture:


Description:

The Journey controller is a wearable controller. It's made of three pieces: a hood, a cape, and the motion controller chest band.  The game Journey emphasizes the isolated loneliness feeling.  The concept model of the controller is to give the player a chance to be the character in the game. Covering the player from head to toe and using motion control create a more immersive experience of the gameplay than its original control. The inputs of the controller are six body motions: leaning forward, leaning backward, tilting left, tilting right, tipping toes, and voices. The output of the controller is corresponding character movements. The mapping of the controller is to map the accelerometer and sound sensor readings of the CPE to the key pressing function which controls the characters movements. The hood and the cape are the signifiers of the controller. They indicate the purpose of the controller is to dress up and play as the character in the game. The feedback mostly reflects on the characters movements and whistles in the game. The controller affords a stronger immersive gameplay experience to create a sense of the connection of motion and emotion between the character and the player.  What other signifier and feedback could be added to the system to make the controller easier to understand?

Schematic:

Video:

Code:

//Libraries
#include <bluefruit.h>
#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>

BLEDis bledis;
BLEHidAdafruit blehid;

//Global variables
int debounce = 100;


void setup() {
  //Bluetooth module setup
  Bluefruit.begin();
  Bluefruit.setTxPower(4);
  bledis.setManufacturer("Adafruit Industries");
  bledis.setModel("Bluefruit Feather 52");
  bledis.begin();
  blehid.begin();
  startAdv();

  //CPE setup
  Serial.begin(9600);
  CircuitPlayground.begin();

}

void loop() {
  if (Bluefruit.connected()) {
    //Accelerometer readings
    float m = CircuitPlayground.mic.soundPressureLevel(10);
    float x = CircuitPlayground.motionX();
    float y = CircuitPlayground.motionY();
    float z = CircuitPlayground.motionZ();
    int p = analogRead(A6);

    //Print readings
    Serial.print(p);
    Serial.print("\t");
    Serial.print(m);
    Serial.print("\t");
    Serial.print(x);
    Serial.print("\t");
    Serial.print(y);
    Serial.print("\t");
    Serial.println(z);

    //Sound sensor readings to Press p key to whistle in the game
    if (m > 70) {
      blehid.keyPress('p');
    }
    //Back to default postion, release all keys
    if (x > -2 && x < 2 && y > -10 && y < -8 && z > -2 && z < 2 && m < 70) {
      blehid.keyRelease();
    }
    //Press w key to move forward
    if (x > -2 && x < 2 && y > -10 && y < -8 && z < -2) {
      blehid.keyPress('w');
    }
    //Press s key to move backward
    if (x > -2 && x < 2 && y > -10 && y < -8 && z > 3) {
      blehid.keyPress('s');
    }
    //Press d key to move right
    if (x < -2 && y > -10 && y < -8 && z > -2 && z < 2) {
      blehid.keyPress('d');
    }
    //Press a key to move lfet
    if (x > 2 && y > -10 && y < -8 && z > -2 && z < 2) {
      blehid.keyPress('a');
    }
    //Press sapce key to jump
    if (x > -2 && x < 2 && y < -10 && z > -2 && z < 2) {
      blehid.keyPress(' ');
    }
    delay(debounce);
  }
}

void startAdv(void)
{
  // Advertising packet
  Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
  Bluefruit.Advertising.addTxPower();
  Bluefruit.Advertising.addAppearance(BLE_APPEARANCE_HID_KEYBOARD);

  // Include BLE HID service
  Bluefruit.Advertising.addService(blehid);

  // There is enough room for the dev name in the advertising packet
  Bluefruit.Advertising.addName();

  /* Start Advertising
     - Enable auto advertising if disconnected
     - Interval:  fast mode = 20 ms, slow mode = 152.5 ms
     - Timeout for fast mode is 30 seconds
     - Start(timeout) with timeout = 0 will advertise forever (until connected)

     For recommended advertising interval
     https://developer.apple.com/library/content/qa/qa1931/_index.html
  */
  Bluefruit.Advertising.restartOnDisconnect(true);
  Bluefruit.Advertising.setInterval(32, 244);    // in unit of 0.625 ms
  Bluefruit.Advertising.setFastTimeout(30);      // number of seconds in fast mode
  Bluefruit.Advertising.start(0);                // 0 = Don't stop advertising after n seconds
}










No comments:

Post a Comment

Note: Only a member of this blog may post a comment.