Commits

Anonymous committed be57f16 Draft

small fix : doc change and lcd module is newly added by default in SConscript

Comments (0)

Files changed (5)

 \.a
 \.d
 \.pyc
+stm32f4_v1
 # At this time, xrange() works in a for loop, but not in a generator expression
 # Yes: for i in xrange(42): pass
 # No:  [x for x in xrange(42)]
-#def xrange(n):
-#    i = 0
-#    while i < n:
-#        yield i
-#        i += 1
-
+def xrange(n):
+    i = 0
+    while i < n:
+        yield i
+        i += 1
 
 #
 # Creates a code object from the given image object

src/platform/stm32f4/SConscript

 SOURCES += glob.glob("FWlib/src/*.c")
 # SOURCES += glob.glob("FWlib/src/*.s")
 
-PY_SOURCES = ["main.py", "stm32f4discovery.py", "gpio.py"]
+PY_SOURCES = ["main.py", "stm32f4discovery.py", "gpio.py", "lcd.py"]
 PM_LIB_ROOT = ["pmvm_%s" % vars.args["PLATFORM"]]
 
 env = Environment(variables = vars,

src/platform/stm32f4/lcd.py

                     from lcd import LiquidCrystal
                     screen = LiquidCrystal(("E",7), None, ("E",8), ("E",9), ("E",10), ("E",11), ("E",12))
                     screen.begin(16,2)
-                    screen.write("2")
+                    screen.prnt("TEOMAN")
         """
         # value authorized for rw are string 'E7' or None !
         if rw is None :

src/platform/stm32f4/main.py

         digital_write("E", 7, HIGH)
         digital_write("E", 7, LOW)
 
+def launch_ipm():
+    """
+    """
+    print "launching ipm"
+    ipm.ipm()
+
 def default_demo():
     """
     """
-    if 1==x.BTN():
-      while True:
+    while True:
         wait_BTN_release()
+        print "btn release ..."
         x.AXEL(0)
         LED_all();
         while 0==x.BTN(): # until push USER BUTTON
           axel= x.AXEL()
           LED_axel_indicate(axel)
           wait_a_bit()
-    else:
-      ipm.ipm()
+
+def my_test():
+    """
+        the main test ...
+    """
+    sys.gc()
+    for j in range(0,200,10) :
+        print j
+        # LED_glow_seq(j)
+        x.LED(0,j)
+        x.LED(1,j)
+        x.LED(2,j)
+        x.LED(3,j)
+        while 0==x.BTN():
+          wait_a_bit()
+        wait_BTN_release()
+        sys.gc()
+        print "hello"
 
 def main():
     """
     """
-    default_demo()
-    # gpio_demo()
+    #my_test()
+    print "hello"
+    launch_ipm()
+    #default_demo()
+    #gpio_demo()
 
+print "going to launch main"
 main()