system
August 10, 2014, 10:04pm
1
Hi there !!
I'm measuring an output signal to RC Arduino and the code works fine with serial Monitor with reading and Minimo Maxino.
#include<Servo.h>
int ch1;
void setup();{
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop()
{
ch1=pulseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.println(ch1);
delay(1000);
}
remember to use your code tags...
#include<Servo.h>
int ch1;
void setup();{
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop()
{
ch1=pulseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.println(ch1);
delay(1000);
we dont't like this:
void setup();{
you cannot use a semicolon there
and add a brace to the end of the sketch:
#include<Servo.h>
int ch1;
void setup()
{
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop()
{
ch1=pulseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.println(ch1);
delay(1000);
}
with the 20 second timeout I don't know why you would need that delay()...
system
August 10, 2014, 10:18pm
3
Genius52:
Hi there !!
I'm measuring an output signal to RC Arduino and the code works fine with serial Monitor with reading and Minimo Maxino.
#include<Servo.h>
int ch1;
void setup();{
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop()
{
ch1=pulseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.println(ch1);
delay(1000);
Now with serial LCD Monitor and values because it does not work?
#include<Servo.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
int ch1;
void setup()
{
pinMode(2,INPUT);
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
ch1=pilseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.printIn()ch1);
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Chanel 1:");
lcd.print(ch1);
delay(1000);
}
use your code tags
#include<Servo.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
int ch1;
void setup()
{
pinMode(2,INPUT);
Serial.begin(9600);
lcd.begin(16,2);
}
void loop() //<<<<<<<<<<<<<<<<<<<<<missing something????
ch1=pilseIn(2,HIGH,20000);//<<<<<<<<<<<<<<<<<<<<<<< pilseIn() ?
Serial.print("Chanel 1:");
Serial.printIn()ch1); //<<<<<<<<<<<<<<<<what do you suppose this will do? is it ln (ell -en) or In (eye-en)? what is this: ()ch1) ?
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Chanel 1:");
lcd.print(ch1);
delay(1000);
}
#include<Servo.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
int ch1;
void setup()
{
pinMode(2,INPUT);
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
ch1=pulseIn(2,HIGH,20000);
Serial.print("Chanel 1:");
Serial.println(ch1);
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Chanel 1:");
lcd.print(ch1);
delay(1000);
}