Notifications
Clear all

3D Video Game using EMG sensors and arduino to control some of the movements in-game

1 Posts
1 Users
0 Reactions
19.8 K Views
 JSFC
(@jsfc)
Member
Joined: 1 year ago
Posts: 1
Topic starter  

I want to make a 3D video game using Unity and have my EMG sensor control the "grabbing" motion in the game. My project partner has already begun coding the game and it is coming along nicely. I have not yet connected the EMG Sensors to the game. At this point I just want to get my EMG sensors to give off decent output. I'll post a list of the items I am using, the code and the output. My current goal is to get the output to act more like the Drone Workshop video (at approx. 27:35):

MyoWare Muscle Sensor - Electromyography (EMG) & Robot Arm (failed attempt)!

My problem:

At the moment, my output seems to be spitting out random numbers and they are not very reactive to my movements. On occasion I may notice a slight rise in the numbers, but overall, they move too fast and don't really change much.

 

Parts:

Myoware EMG Sensor v2.0

Sparkfun RedBoard Artemis

Adafruit USB Isolator

all shields and cables to connect it to the PC.

 

Code to get a read out of the EMG Sensors when I make a "grabbing" motion:

 
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}


// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 3.3V):
  float voltage = sensorValue * (3.3 / 1023.0);
  // print out the value you read:
  Serial.print(0);
  Serial.print(" ");
  Serial.print(1000);
  Serial.print(" ");
 // Serial.println(voltage);


  Serial.println(sensorValue);
}

 
 
The output:
 
output1
output2

I was playing around with the "float voltage" line so the output might not match the code exactly. But nevertheless the randomness is still there.

 


   
Quote