HX711 bodge library with display shield 1602 - issues reading a0


hi all, relatively new arduino programing , have following issue:

i have arduino uno display shield 1602 connected it. additionally have hx711 a/d connected on display shield in way a1 connected ck/tx , a3 connected do/rx. if try read a0 (meaning keys on display shield) analogread(a0) reads ok until try initialize hx711 library (with hx711 scale(a3, a1); line ) once added code analogread(a0) returns number 7.

the example code can used replicate

code: [select]
#include <hx711.h>
#include <liquidcrystal.h>

liquidcrystal lcd(8, 9, 4, 5, 6, 7);
hx711 scale(a3, a1);

void setup() {
  // set lcd's number of columns , rows:

  lcd.begin(16, 2);
  // print message lcd.
  lcd.setcursor(0,0);
  lcd.print("lcd key shield");
  lcd.setcursor(0,1);
  lcd.print("press key:");
}

void loop() {
  int x;
  x = analogread (0);
  lcd.setcursor(10,1);
  if (x < 60) {
    lcd.print ("right ");
  }
  else if (x < 200) {
    lcd.print ("up    ");
  }
  else if (x < 400){
    lcd.print ("down  ");
  }
  else if (x < 600){
    lcd.print ("left  ");
  }
  else if (x < 800){
    lcd.print ("select");
  }
}




if line hx711 scale(a3, a1); removed keys read correctly. once add line 'press key: right' (since analogread(a0) 7).

could point me doing wrong? there restriction usage of analog pins on display shield?

  help,

             marek

try swapping a0..a3.


Arduino Forum > Using Arduino > Project Guidance > HX711 bodge library with display shield 1602 - issues reading a0


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code