Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Kispálné Simon Zsuzsanna
Published © LGPL

Cute Magnetic Nyan Cat Game

The game about my favorite internet meme, Nyan Cat, who is controlled using a magnet!

BeginnerFull instructions provided6 hours1,657

Things used in this project

Hardware components

3D Magnetic Sensor 2Go
Infineon 3D Magnetic Sensor 2Go
×1
Infineon magnetic rotator knob
×1
Polystyrene Ball
×1
Highlighters
×1

Software apps and online services

Arduino IDE
Arduino IDE
Unity
Unity

Story

Read more

Schematics

The board and the rotator

Code

Nyan cat game

C#
Exported game. If you download it you can play the game without Unity installed
No preview (download only).

Infineon Magnetic Sensor 2 Go board's code

Arduino
upload it to the board
#include <Tle493d_w2b6.h>

Tle493d_w2b6 Tle493dMagnetic3DSensor = Tle493d_w2b6();
void setup() {
  Serial.begin(9600);

  Tle493dMagnetic3DSensor.begin();
  Tle493dMagnetic3DSensor.begin();
  Tle493dMagnetic3DSensor.enableTemp();
}

void loop() {
  Tle493dMagnetic3DSensor.updateData();

  Serial.print(Tle493dMagnetic3DSensor.getNorm() > 30); // Pushed down
  Serial.print(";");
  Serial.print(Tle493dMagnetic3DSensor.getAzimuth() / PI);  // Scaling to -1 to 1
  Serial.println(";");

  delay(25);
}

Unity code

C#
source code of the game
No preview (download only).

Credits

Kispálné Simon Zsuzsanna

Kispálné Simon Zsuzsanna

1 project • 3 followers

Comments