Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <VirtualWire.h>
- String wiad = "Pusto :(";
- void setup() {
- Serial.begin(9600);
- vw_set_ptt_inverted(true);
- vw_setup(2000);
- vw_set_rx_pin(4);
- vw_rx_start();
- }
- void loop() {
- uint8_t odebrano[VW_MAX_MESSAGE_LEN];
- uint8_t dlugosc = VW_MAX_MESSAGE_LEN;
- if(vw_get_message(odebrano, &dlugosc)) {
- String wiadomosc;
- int i;
- for(i = 0; i < dlugosc; i++) {wiadomosc += char(odebrano[i]);}
- wiad=wiadomosc;
- }
- Serial.println(wiad);
- delay(100);
- }
- //Problem w tym, że na Serial Monitorze ciągle dostaję defaultową wiadomość - czyli podstawową zawartość zmiennej wiad;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement