Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
anolog input for pinguino
22-10-2012, 07:19 PM,
#1
anolog input for pinguino
hai, anybody can help me, why i compile the program below is error ? i am beginner. i am using 18f4550. thank you.
https://sites.google.com/site/pinguinotu...alog-value



// test blink with Pinguino

#define PIC18F4550

// pin where the led is connected
#define LED 0

void setup()
{
pinMode(LED,OUTPUT);
}

void loop() T
{
digitalWrite(LED,HIGH);
delay(300+analogRead(15));
digitalWrite(LED,LOW);
delay(300+analogRead(15));
}
Reply
22-10-2012, 09:08 PM,
#2
RE: anolog input for pinguino
Hi,
You don't need to #define PIC18F4550 anymore, the IDE will do it automatically for you.
I think it's a typo but I saw a "T" after "void loop()".
Finally, I think the IDE has a bug because it compiles OK when I added spaces arround "+" sign : delay(300 + analogRead(15));

(22-10-2012, 07:19 PM)wilson16 Wrote: hai, anybody can help me, why i compile the program below is error ? i am beginner. i am using 18f4550. thank you.
https://sites.google.com/site/pinguinotu...alog-value



// test blink with Pinguino

#define PIC18F4550

// pin where the led is connected
#define LED 0

void setup()
{
pinMode(LED,OUTPUT);
}

void loop() T
{
digitalWrite(LED,HIGH);
delay(300+analogRead(15));
digitalWrite(LED,LOW);
delay(300+analogRead(15));
}
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
22-10-2012, 10:29 PM,
#3
RE: anolog input for pinguino
(22-10-2012, 09:08 PM)regis Wrote: Hi,
You don't need to #define PIC18F4550 anymore, the IDE will do it automatically for you.
I think it's a typo but I saw a "T" after "void loop()".
Finally, I think the IDE has a bug because it compiles OK when I added spaces arround "+" sign : delay(300 + analogRead(15));

(22-10-2012, 07:19 PM)wilson16 Wrote: hai, anybody can help me, why i compile the program below is error ? i am beginner. i am using 18f4550. thank you.
https://sites.google.com/site/pinguinotu...alog-value



// test blink with Pinguino

#define PIC18F4550

// pin where the led is connected
#define LED 0

void setup()
{
pinMode(LED,OUTPUT);
}

void loop() T
{
digitalWrite(LED,HIGH);
delay(300+analogRead(15));
digitalWrite(LED,LOW);
delay(300+analogRead(15));
}

thank you..i have success to compile.^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)