Newbie question

Hi all!

i cant my PIR with a 433Mhz transmitter code to work. Can anybody tell me whats wrong? "Verification says "vw_setup was not declared in this scope"

Heres the code:

int pirPin = 2;
int statePir = 0;

void setup() {
Serial.begin(9600);

vw_setup(2000);

vw_set_tx_pin(3);

pinMode(pirPin,INPUT);
// put your setup code here, to run once:

}

void loop() {
statePir = digitalRead(pirPin);

if (statePir == HIGH){

const char *msg = "A";

vw_send((uint8_t *)msg, strlen(msg));

vw_wait_tx();
// put your main code here, to run repeatedly:

}

if (statePir == LOW){

const char *msg = "a";

vw_send((uint8_t *)msg, strlen(msg));

vw_wait_tx();

}

}

You're missing a #include for VirtualWire

Ok i fix it, but now it says "Error compiling for board Arduino uno". What does that mean?

It means you didn't post the whole error message.

You don’t understand this game.

You show us all your code and complete errors.
We suggest solutions.
You make changes and show us all your code and complete error.
etc.

Always show us your ‘current’ compete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

Can you get a simple program link 'blink' working?

Ok, last post. Ive installed the Teensy but i says:

Teensy did not respond to a USB-based request to enter program mode.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

I Cant press the button on the teensy. What am i doing wrong??

Chrismeister76:
Ok, last post. Ive installed the Teensy but i says:

Teensy did not respond to a USB-based request to enter program mode.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

I Cant press the button on the teensy. What am i doing wrong??

Are you programming a Teensy or an Arduino Uno?

If it's a Teensy - you might to better on the Teensy support forum. But why can't you push the button on the Teensy? That may be necessary to resolve it.

Chrismeister76:
Ok i fix it, but now it says "Error compiling for board Arduino uno". What does that mean?

That is always the last line when there is a compilation error. Scroll up to see what the actual error that it encountered is.