SALUDOS HE ELIMINADO LA LINEA <Class_define.h>

SALUDOS HE ELIMINADO LA LINEA <Class_define.h>

EL PROGRAMA SI COMPILA . PERO AL MONENTO DE CARGAR AL INDUSTRUINO LA PANTALLA SALE EN BLANCO NO IMPRIME LOS (MA)

----------------------------------------------------------------
#include <Indio.h> //load Indio library
#include <Wire.h> //i2c library required for Indio
#include <UC1701.h> //load LCD library

float sensorVal1; //variable to hold analog reading
static UC1701 lcd; 

void setup()
{
  pinMode(13, OUTPUT); //Set LCD backlight pin as output
  analogWrite(13, 240); //set LCD backlight intensity, 0 is full brightness, 255 is off.
  lcd.begin(); //start LCD
  
  Indio.setADCResolution(16); // Set the ADC resolution. Choices are 12bit@240SPS, 14bit@60SPS, 16bit@15SPS and 18bit@3.75SPS.

  Indio.analogReadMode(1, mA); // Set Analog-In CH1 to mA mode (0-20mA).
  Indio.analogReadMode(2, mA); // Set Analog-In CH2 to mA mode (0-20mA).
  Indio.analogReadMode(3, mA); // Set Analog-In CH3 to mA mode (0-20mA).
  Indio.analogReadMode(4, mA); // Set Analog-In CH4 to mA mode (0-20mA).
}
void loop()
{

  sensorVal1=Indio.analogRead(1); //Read Analog-In CH1 (output depending on selected mode)
  lcd.setCursor(40, 3); //set LCD cursor position to middle of screen, column 40, row 3.
  lcd.print("    "); //Add some "  " space
  lcd.setCursor(40, 3);
  lcd.print(sensorVal1, 3); //Print data
  lcd.print(" mA"); //Print unit
  delay(200);
}

JUAN GUALOTO
JUAN GUALOTO
0
| 0 0 0
Asked on 5/9/18, 8:41 PM
0
vote
2527 Views

Hi Juan,

Assuming you are using a recent INDIO (with a D21G topboard) the backlight pin is 26 not 13, so the first lines need to be:

  pinMode(26, OUTPUT); //Set LCD backlight pin as output
  analogWrite(26, 240); //set LCD backlight intensity, 0 is off, 255 is full.
In your loop() include some text to show in the upper left to make sure it's in the visible part of the screen:

lcd.setCursor(0,0);

lcd.print("analog input");

Have you powered the INDIO with external 12/24V? USB power only is not sufficient to use the I/O

Tom
Tom
5675
| 1 1 3
Answered on 5/9/18, 11:55 PM
0
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

44 follower(s)

Stats

Asked: 5/9/18, 8:41 PM
Seen: 2527 times
Last updated: 5/9/18, 11:55 PM