My LCD Displays Lines and Garbage

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 7, 6, 1, 0);

void setup() {
lcd.begin(16, 2);
lcd.print("hello, world!");
}

void loop() {

}

here's the code i've been trying also tried
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 7, 6, 1, 0);

void setup() {
lcd.begin(16, 2);
}

void loop() {
lcd.print("hello, world!");
delay(500);
lcd.clear();
delay(500);
}

attached are photo's

I've tried so many different combinations for the db4-7 and PWMs, it's frustrating...

The blinking does work!
and the pot works!

I would like the display to work properly though with the actual desired text.

The fourth link "94564697_1389044131274795_5877179990251929600_n.jpg" shows the garbage I receive.

94491864_249761713057164_3368439058073124864_n.jpg

LiquidCrystal lcd(12, 11, 7, 6, 1, 0);

You have chosen Serial pins 0, 1. This will guarantee garbage.

I've tried so many different combinations for the db4-7 and PWMs, it's frustrating...

Any other pins should work for the data bus.

David.

When I use ~5, ~4, ~3, ~2, i get very similar garbage and lines, sometimes flashing sporadically and quickly ...

also my potentiometer works, turning the dial changes the brightness of the garbage, but if i wiggle it at all, it easily changes whats on the screen.... like a little wiggle can make a whole box appear. I've tried different pots and they all do this weird effect.

turning = appropriate

any bad touch, bounce, or wiggle = more or less garbage appears on screen. (without a change in brightness)

anyone got any ideas?

can the lcd break?

should I not use 12 and 11 for RS and E? I am using a MKR1000 board mind you.

I would guess that MKR1000 should drive a 16x2 just fine.

Just wire it correctly to match your constructor.

Post a clear photo of your wiring i.e. showing MKR1000 pins and showing LCD pins.

Hint. Use consistent colours e.g. BLACK for GND, RED for VCC, other colours for signals.

If you only have one colour of connecting wire, bend each wire to show e.g. right angle bends, cross wires at right angles like on a schematic.

Single core wire is cheap. Cut wires to correct length.

David.

here's a table of what I have, as the photo's on the first post are about as good as I can get

Vss to GND
VDD to 5v
V0 to pot which branches into 1 GND and 1 5v ( this has been an annoying area as bumping the pot at all messes with the clarity and its hard to see even at the max brightness)
RS goes to pin 12 (SCL)
R/W goes to ground
E goes to 11 SDA
d4 to ~5
d5 to ~4
d6 to ~3
d7 to ~2
LED+ to a red red brown gold resistor to pin 0 ( so i can analogWrite(0, Brightness) to have an adjustable back light, without it being adjustable its soo bright and the potentiometer on V0 can't do enough to show anything)
LED- to GND

Seriously. It is worth bending your connecting wires to show the routes. e.g. straight lines with 90 degree bends. like a schematic.

LED+ to a red red brown gold resistor to pin 0 ( so i can analogWrite(0, Brightness) to have an adjustable back light, without it being adjustable its soo bright and the potentiometer on V0 can't do enough to show anything)
LED- to GND

You should just use a series resistor to the backlight. Your photo looks like the 220R is plugged into the same breadboard row i.e. shorted. 220R should give a dim backlight.
The pot controls contrast. If the backlight changes, it means that something is wrong with your wiring.

When taking a photo it is probably better with the backlight off. We need to see the wires. Not a bright light.

David.

so I tried changing it to V0 to wire to resistor into the 5v, and that's pretty good for the lighting balance.

This is a little dirty, I was using a very well put together set with regular wires but I heard for testing it's better to use the "jumper" wires so I switched to those with marginally better results.

attached are newer photos.

on the lcd I only get boxes.....

// include the library code:
#include <LiquidCrystal.h>
#include <SPI.h>
#include <WiFi101.h>
#include <FlashStorage.h>
#include <RTCZero.h>
#include <WiFiUdp.h>

#define MAGIC_NUMBER 0x7423 // arbitrary number to double check the validity of SSID
#define MaxNet 30 // max amount of network to be saved

int Buzz = A3;
int Sens = A2;

int PosToBeSaved = 0; // Variable used to navigate the array of saved networks
int daily_amount_of_food = 1; // The amount of food per day needed to survive
int sleeping_time = 1800000; // 30 min *60 sec *1000 millisec

bool atHome = false;
bool hungry=true;
bool justWokeUp=false;

// Struct of variable to be saved in flash memory
typedef struct {
int magic;
boolean valid[MaxNet];
char SSIDs[MaxNet][100];
int alive_days;
int last_time_feeded;
} Networks;

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:

analogWrite(0,70); // backlight brightness
}

void loop() {
pinMode(Buzz, OUTPUT);
tone(Buzz, 50);
delay(50);
noTone(Buzz);
delay(100);

lcd.print("hello");

lcd.setCursor(0,2);

delay(500);

lcd.print("hello");

delay(500);

lcd.setCursor(0,1);

lcd.print("hello");

int SensorValue = analogRead(Sens);

// Awaking notification
if(SensorValue > 1){
if (justWokeUp=false){
justWokeUp=true;
tone(Buzz, 31, 200); // tone(Pin, Note, Duration);
delay(200);
noTone(Buzz);
delay(1000);
}
}

}

trying out the "nerd" project for the IoT kit

I've tried the lcd.write("hello") and also using and 8 byte array to make a custom character. None the less, all simply boxes.

It is pretty simple.

You connect the power wires neatly to GND, 5V.
And connect the signal wires to your MKR1000.

You ensure that the constructor LCD arguments match the digital pin numbers on the MKR1000.

I bet that the example sketch and wiring diagram will work straight out of the box on your MKR1000.

My apologies for earlier comment about digital#0, #1. They are Serial RXD, TXD on most Arduinos but not on the MKR1000.

Do you see how the "wiring" is easier to view when neatly layed out in straight lines with 90 deg bends?

David.