--- /dev/null
+#include <iostream>
+
+int main()
+{
+ unsigned char c =0;
+ unsigned char sym =0;
+ unsigned char old_sym =0;
+ int counter = 0;
+ while( 1)
+ {
+ std::cin >> c;
+ for(int i = 0; i<8; i++)
+ {
+ sym = c & (1<<7);
+ if (sym == old_sym)
+ {
+ counter++;
+ } else {
+ if (counter > 30 )
+ {
+ std::cout << std::endl;
+ }
+ counter = 0;
+ }
+
+ if( sym)
+ {
+ std::cout << 'X';
+ } else {
+ std::cout << '_';
+ }
+ c<<=1;
+ old_sym=sym;
+ }
+ }
+}
TIMSK1 = 0; // disable timer interrupt
}
+byte rf433_data=0;
+byte rf433_cnt=0;
ISR(TIMER1_COMPA_vect)
{
- digitalRead(RF433_PIN);
+ rf433_data<<=1;
+ if (digitalRead(RF433_PIN) == HIGH)
+ rf433_data |=1;
+ rf433_cnt++;
+ if (rf433_cnt>7)
+ {
+ Serial.print(rf433_data);
+ rf433_cnt=0;
+ rf433_data=0;
+ }
}
//unsigned long wm_start_[3]={0,0,0};
digitalWrite(RF433_PIN, LOW); // turn of pullup resistors
Serial.begin(57600);
+ Serial.println("starting timer");
start_timer();
}