'Raspberry pi PICO ADC reading [closed]
Why not get zero when taking ADC readings on Raspberry Pi Pico? Even though I ground the ADC pin, the analog reading always fluctuates between 10 to 20. How can analog reading be reduced to zero?
Solution 1:[1]
Try with startTransaction and commitTransaction.
Something like this:
const session = await mongoose.startSession();
session.startTransaction();
try {
const promise1 = User.create([users[0]], { session });
const promise2 = User.create([users[1]], { session });
const promise3 = User.create([users[2]], { session });
await Promise.all([promise1, promise2, promise3]);
await session.commitTransaction();
} catch(error){
// Rollback any changes made in the database
await session.abortTransaction();
// logging the error
console.error(error);
// Rethrow the error
throw error;
} finally {
// Ending the session
session.endSession();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ana Lava |
