Browse Source

868Mhz and typo from other fork

Sebastien Bechet 5 years ago
parent
commit
e003be0c11
2 changed files with 8 additions and 5 deletions
  1. 2 2
      README.md
  2. 6 3
      pycc1101/pycc1101.py

+ 2 - 2
README.md

@@ -8,9 +8,9 @@ I developed this module for learning purposes and included two simple examples f
 ### Steps to make it work ###
 
 1. Clone this repository
-2. virutalenv pycc1101
+2. virtualenv pycc1101
 3. Activate the virtualenv
 4. pip install spidev
 5. python tx.py
 6. Perform steps 1-4 in other machine with the module connected.
-7. python rx.py
+7. python rx.py

+ 6 - 3
pycc1101/pycc1101.py

@@ -190,9 +190,12 @@ class TICC1101(object):
             self._writeSingleByte(self.FREQ2, 0x10)
             self._writeSingleByte(self.FREQ1, 0xA7)
             self._writeSingleByte(self.FREQ0, 0x62)
-
+        elif freq == 868:
+            self._writeSingleByte(self.FREQ2, 0x21)
+            self._writeSingleByte(self.FREQ1, 0x62)
+            self._writeSingleByte(self.FREQ0, 0x76)
         else:
-            raise Exception("Only 433MHz is currently supported")
+            raise Exception("Only 433MHz and 868MHz are currently supported")
 
     def setChannel(self, channel=0x00):
         self._writeSingleByte(self.CHANNR, channel)
@@ -388,7 +391,7 @@ class TICC1101(object):
 
     def _getMRStateMachineState(self):
         # The &0x1F works as a mask due to the fact
-        # that the MARCSTATE register only uses the 
+        # that the MARCSTATE register only uses the
         # first 5 bits
         return (self._readSingleByte(self.MARCSTATE) & 0x1F)