eu estou tentando fazer um simples “Hello World” mais não está dando certo
ele compila, envia pro arduino, mais não aparece na tela…
tentei vários tutoriais que não envolve o LCD e deu certo… por exemplo este:
[code]int ledPin = 13; // LED connected to digital pin 13
void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(1000); // wait for a second
}[/code]
eu estou tentando fazer um simples “Hello World” mais não está dando certo
ele compila, envia pro arduino, mais não aparece na tela…
tentei vários tutoriais que não envolve o LCD e deu certo… por exemplo este:
[code]int ledPin = 13; // LED connected to digital pin 13
void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(1000); // wait for a second
}[/code][/quote]
Cara, por isso que eu tenho medo de comprar essas coisas pela internete.
é o seu primeiro teste?
vc incluiu as bibliotecas?
tipo isso aqui:
//olha onde tirei esse fonte. pode ser que te ajude: http://www.arduino.cc/en/Tutorial/LCDLibrary
#include <LiquidCrystal.h> //include LiquidCrystal library
LiquidCrystal lcd = LiquidCrystal(); //create a LiquidCrystal object to control an LCD
void setup(void){
lcd.init(); //initialize the LCD
digitalWrite(13,HIGH); //turn on an LED for debugging
}
void loop(void){
lcd.clear(); //clear the display
delay(1000); //delay 1000 ms to view change
lcd.print('a'); //send individual letters to the LCD
lcd.print('b');
lcd.print('c');
delay(1000);//delay 1000 ms to view change
} //repeat forever
tenta iniciarseu lcd como nesse exemplo.
Seu lcd pode tá quebrado.
é o seu primeiro teste?
R: com o LCD sim. Somente o arduino já fiz vários testes e todos funcionou, até pluguei um “som” nele e tocou… (akeles bip de computador)
vc incluiu as bibliotecas?
R: sim, testei também com 2 IDE diferente, arduino-0023 e arduino-1.0.1-windows
detalhe: uso win7, o arduino está na COM15 e as duas IDE’s configurada com a COM certinha…
tentei também: LCD4Bit_mod, LCDKeypad
Esses testes com lcd.print fiz vários e nenhum funcionou
lcd.print(‘x’);
montei daquela forma como mostra ali mesmo, tentei esse código ai e nada também
to achando que é outro problema… deve ser a IDE, a LIB, o WINDOWS ou o lcd mesmo :(… mais ele acende… e teve um código q eu peguei (agora nao sei qual) que quando eu apertava uma tecla (up, down, qlqr uma) ele piscava o lcd… porém até agora nao consegui escreve nada nele…
o upload faz certinho “Done uploading.”
Binary sketch size: 2318 bytes (of a 32256 byte maximum)
se não funcionar, desisto. Teria que pegar pra ver seu tutorial. Não sei qual é seu arduino.
/*
The circuit:
* LCD RS pin to digital pin 8
* LCD Enable pin to digital pin 9
* LCD D4 pin to digital pin 4
* LCD D5 pin to digital pin 5
* LCD D6 pin to digital pin 6
* LCD D7 pin to digital pin 7
* LCD BL pin to digital pin 10
* KEY pin to analogl pin 0
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
char msgs[5][16] = {"Right Key OK ",
"Up Key OK ",
"Down Key OK ",
"Left Key OK ",
"Select Key OK" };
int adc_key_val[5] ={50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;
void setup()
{
lcd.clear();
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print("ADC key testing");
}
void loop()
{
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press
if (key != oldkey) // if keypress is detected
{
delay(50); // wait for debounce time
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press
if (key != oldkey)
{
lcd.setCursor(0, 1);
oldkey = key;
if (key >=0){
lcd.print(msgs[key]);
}
}
}
delay(100);
}
// Convert ADC value to key number
int get_key(unsigned int input)
{
int k;
for (k = 0; k < NUM_KEYS; k++)
{
if (input < adc_key_val[k])
{
return k;
}
}
if (k >= NUM_KEYS)k = -1; // No valid key pressed
return k;
}
o LCD Keypad Shield eh esse ai mesmo… o arduino é o UNO, azul em cima e branco em baixo…
Board Model UNO R3
tem um EPROM escrito ATMEGA328P-PU e do lado o site www.arduino.cc (que foi onde fiz o download da IDE)
Cara, isso era pra ser bem facinho. Se vc tá com muita dificuldae é bem possivel que vc tenha comprado com defeito.
Não conhece alguem ai que tenha uma funcionando?
intão cara… a 0016 não abre no win7 e nem no mac… e o 0017 da esse erro:
java.io.IOException: Target platform: "null" not found.
Make sure that "build.target" in the
preferences file points to a subdirectory of
C:\Users\alan\Downloads\arduino-0017\arduino-0017\hardware\cores
at processing.app.debug.Target.<init>(Target.java:49)
at processing.app.Editor$43.run(Editor.java:1751)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[quote=alandiniz]intão cara… a 0016 não abre no win7 e nem no mac… e o 0017 da esse erro:
java.io.IOException: Target platform: "null" not found.
Make sure that "build.target" in the
preferences file points to a subdirectory of
C:\Users\alan\Downloads\arduino-0017\arduino-0017\hardware\cores
at processing.app.debug.Target.<init>(Target.java:49)
at processing.app.Editor$43.run(Editor.java:1751)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[/quote]
[quote=alandiniz]bom cheguei a conclusão que meu LCD está com problema.
Todos os testes feito somente com o arduino uno deram certo. porém os testes com o arduino + lcd deram errado.
Testei com Win7, Mac, WinXP e todos falharam. Testei com todas as IDE’s acima de “arduino-0020” com download feito no wwww.arduino.cc[/quote]
calma, não se desespere ainda.
se vc não tem nenhum conhecido perto de vc tente ir na faculdade. Lá com certeza tem alunos estudando com essas mesmas placas.
uma outra forma de vc testar seu lcd é pegar o dataset dele e estudar, para utilizar a porta paralela de seu computador, simulando seu arduino.
Programa seu computador para enviar sinais à sua placa pra ver se ela responde conforme o dataset preve.
deve ter algum exemplo já montado para teste com paralela.
Esse é um exemplo para um tipo de lcd: http://wearcam.org/seatsale/programs/www.beyondlogic.org/parlcd/parlcd.htm
Brother, tbm comprei esse kit e consegui fazer ele funcionar…to te mandando meu codigo…abraço.
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints “Hello World!” to the LCD
and shows the time.
The circuit:
LCD RS pin to digital pin 12 8
LCD Enable pin to digital pin 11 9
LCD D4 pin to digital pin 5 4
LCD D5 pin to digital pin 4 5
LCD D6 pin to digital pin 3 6
LCD D7 pin to digital pin 2 7
LCD R/W pin to ground
10K resistor:
ends to +5V and ground
wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
// include the library code: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“Hello World!”);
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}