2.Arduino+液晶SC1602BS×2個の実験


(1)実験写真

https://www.youtube.com/watch?v=K8VHgpRajQc






(2)回路図


(3)スケッチ

#include <LiquidCrystal.h>

LiquidCrystal lcd1(2, 3, 4, 14, 15, 16, 17);

LiquidCrystal lcd2(2, 3, 5, 14, 15, 16, 17);

void setup()
{

lcd1.begin(16, 2) ;
lcd1.clear() ;
lcd1.setCursor(0,0) ;
lcd1.print("Duration 1224 us") ;
lcd1.setCursor(0,1) ;
lcd1.print("Distance 20 cm") ;


lcd2.begin(16, 2) ;
lcd2.clear() ;
lcd2.setCursor(0,0) ;
lcd2.print("\xc1\xb4\xdd\xbc\xde\xb6\xdd 1224 us") ;
lcd2.setCursor(0,1) ;
lcd2.print("\xbf\xb8\xc3\xb2\xb7\xae\xd8 20 cm") ;

delay(3000) ;

}

void loop()
{

delay(500);

}