Lecture 3 Lab
Lecture 3 Lab
instrumentation
void loop() {
// put your main code here, to run
repeatedly:
}
PinMode
• analogWrite(2,128);
ADC Example
voltage MetER
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int VoltageValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
s VoltageValue = analogRead(analogInPin);
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2);
// set the LCD address to 0x3F for a 16 chars and 2 line
display
void setup() {
lcd.init();
lcd.clear();
lcd.backlight();
// Make sure backlight is on // Print a message on both lines
of the LCD.
lcd.setCursor(2,0);
//Set cursor to character 2 on line 0
lcd.print("Hello world!");
lcd.setCursor(2,1); //Move cursor to character 2 on line 1
lcd.print("LCD Tutorial"); } void loop() { }
Ohm Meter
R2 = Vout * R1 / (Vin – Vout)
Ohm Meter
Auto range