//***************Arduino code used in video*******************************
/*This code demonstrates how to change the ADC voltage reference on an Arduino
* This was shown in an ADC tutorial on the ForceTronics YouTube Channel.
* This code is free and open for anybody to use at their own risk.
*/
void setup() {
Serial.begin(115200); //setup serial connection
while(!Serial);
analogReference(AR_EXTERNAL); //sets the ADC reference voltage to external (input is aRef pin)
//analogReference(AR_DEFAULT); //set the ADC reference to default which is AVCC (uses power supply voltage or VCC as reference)
//analogReference(AR_INTERNAL2V23); //uses 2.23V internal reference in SAMD21 uC
analogReadResolution(12); //Set ADC to 12bit resolution, default is 10
burn8Readings(); //make 8 readings but don't use them to ensure good reading after reference change
delay(100);
for(int i=0;i<500;i++) { //loop through a bunch of ADC readings and print them to serial plotter
Serial.println(analogRead(A0)); //Make ADC measurement at A0
}
}
void loop() {
//don't need the loop
}
//This function makes 8 ADC measurements but does nothing with them
//Since after a reference change the ADC can return bad readings at first. This function is used to get rid of the first
//8 readings to ensure an accurate one is displayed
void burn8Readings() {
for(int i=0; i<8; i++) {
analogRead(A0);
delay(1);
}
}
This specific keeps the pinnacle straight and even holds this forearm plus submit the perfect spot regarding publishing. https://imgur.com/a/XL1pgv5 https://imgur.com/a/JtmSWCR https://imgur.com/a/FqhHV0U https://imgur.com/a/x8ovLxP https://imgur.com/a/c4egrm7 https://imgur.com/a/rcAwqBy https://imgur.com/a/YD7WfQD
ReplyDeleteWe all know that analog inputs drift a lot, so I am using the ADS1015, and this gives me a very stable reading.
ReplyDeleteThe code is quit different from the code in the video. Otherwise a very good video.
ReplyDeleteThe code is quit different from the code in the video. Otherwise a very good video.
ReplyDelete