Permalink
Browse files

basic file system implementation on write to eeprom

  • Loading branch information...
1 parent e616acb commit b23f2e9c9d48fd87cc47a4c074c54bba4fb83981 @sweemeng committed Apr 8, 2011
Showing with 33 additions and 0 deletions.
  1. +33 −0 file_table.py
View
@@ -0,0 +1,33 @@
+import serial
+
+class DataLoader:
+ def __init__(self):
+ self.header = ''
+ self.words = {}
+ self.s = serial.Serial(2)
+ self.data = ''
+
+ def create_category(category):
+ self.words[category] = []
+
+ def add_word(category,word):
+ self.words[category].append(word)
+
+ def write(self):
+ to_write = self.header + self.data
+ for i in to write:
+ s.write(i)
+
+ def prepare(self):
+ for i in words:
+ temp = ':'.join(words[i])
+ length = len(temp)
+ b = int_to_byte(length)
+ self.header = self.header + b
+ self.data = self.data + temp
+
+ def int_to_byte(self,no):
+ pass
+
+
+

0 comments on commit b23f2e9

Please sign in to comment.