Skip to content

Commit

Permalink
fix seedRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Nov 16, 2023
1 parent bb13417 commit cc94488
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/MicroBitDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ void MicroBitDevice::seedRandom()
if(ble_running())
{
// Readings from different sensors
int16_t accelerometerX = uBit.accelerometer.getX();
int16_t accelerometerY = uBit.accelerometer.getY();
int16_t accelerometerZ = uBit.accelerometer.getZ();
int16_t temperatureValue = uBit.thermometer.getTemperature();
int16_t microphoneValue = uBit.io.MICROPHONE.getAnalogValue();
int16_t accelerometerX = accelerometer.getX();
int16_t accelerometerY = accelerometer.getY();
int16_t accelerometerZ = accelerometer.getZ();
int16_t temperatureValue = thermometer.getTemperature();
int16_t microphoneValue = io.MICROPHONE.getAnalogValue();

// Combine sensor values using XOR
r = accelerometerX ^ accelerometerY ^ accelerometerZ ^ temperatureValue ^ microphoneValue;
Expand Down

0 comments on commit cc94488

Please sign in to comment.