Close

Code

A project log for Sky rider game controller

Interactive game controller for the Sky riders online game

angleAngèle 12/05/2023 at 15:310 Comments

We used arduino to test our system, and see the different value when we applied different weight on our sensor:

#include "HX711.h"

const int DOUT_PIN = 2;
const int SCK_PIN = 3;

HX711 scale;

void setup() {
  Serial.begin(9600);
  scale.begin(DOUT_PIN, SCK_PIN);
}

void loop() {
  if (scale.is_ready()) {
    long weight = scale.get_units(); // Get the weight in grams
    Serial.println("Weight: " + String(weight) + " g");
    delay(1000); // You can adjust the delay based on your requirements
  } else {
    Serial.println("Error reading from scale");
  }
}

Discussions