arduino.ino 419 B

1234567891011121314151617181920
  1. #include <RCSwitch.h>
  2. RCSwitch rcSwitch = RCSwitch();
  3. void setup() {
  4. rcSwitch.enableTransmit(10);
  5. Serial.begin(9600); // == 2400 wtf???
  6. pinMode(A0, INPUT);
  7. }
  8. void loop() {
  9. unsigned int val=abs(analogRead(A0));
  10. unsigned long U=round(val * 0.006270 * 1000);
  11. Serial.println(U);
  12. Serial.println(U << 8 | 0x00);
  13. rcSwitch.send(U << 8 | 0x00, 24);
  14. delay(1000);
  15. }
  16. // 244 = 1.53
  17. // 100 = X