Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <RH_ASK.h>
- #include <SPI.h> // Not actually used but needed to compile
- #include <PCD8544.h> //LCD include
- RH_ASK driver;
- static PCD8544 lcd;
- int potPin = A0; //select the input pin for the potentiometer
- int val = 0; //variable to store the value coming from the sensor
- String tussenwaarde = "";
- String waarde = "";
- String eindwaarde = "";
- void setup()
- {
- Serial.begin(9800); // Debugging only
- if (!driver.init())
- Serial.println("init failed");
- // PCD8544-compatible displays may have different resolution
- lcd.begin(84, 48);
- }
- void loop()
- {
- val = analogRead(potPin); //reading the potentiometer
- waarde = String(val);
- delay(200);
- Serial.println(waarde);
- // Write the first line of the message
- lcd.setCursor(0, 0);
- lcd.print("Message send = ");
- // Write the counter on the second line...
- lcd.setCursor(0, 1);
- lcd.print(waarde);
- lcd.write(' ');
- int str_length = waarde.length() + 1;
- char tosend[waarde.length() + 1];
- waarde.toCharArray(tosend, sizeof(waarde));
- const String *analog = val;
- //const char *msg = "Hello World!";
- driver.send((uint8_t *)tosend, str_length);
- driver.waitPacketSent();
- //delay(1000);
- //Serial.println(analog);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement