Exemple #1
0
    # print "Grove I2C test"
    # os.system("echo \"----------------------------Grove I2C test----------------------------\n\" >> " + report_file)
    # if pins.check_i2c() == 'ok':
    # oled.myPrint("I2C TEST", "OK")
    # os.system("echo \"Grove I2C test   ------>[pass]\n\n\" >> " + report_file)
    # else:
    # oled.myPrint("I2C TEST", "Fail")
    # os.system("echo \"Grove I2C test   ------>[fail]\n\n\" >> " + report_file)
    # report_error()

    # analog pins test
    print "analog pins test"
    os.system(
        "echo \"----------------------------analog pins test---------------------------\n\" >> "
        + report_file)
    status, result = pins.check_voltage()
    for v in result:
        os.system("echo \"" + v + "\n\" >> " + report_file)
    if status == 'ok':
        oled.myPrint("ANALOG", "OK")
        os.system("echo \"analog pins test   ------>[pass]\n\n\" >> " +
                  report_file)
    else:
        oled.myPrint("ANALOG", "Fail")
        os.system("echo \"analog pins test   ------>[fail]\n\n\" >> " +
                  report_file)
        report_error()

    # PMU test
    print "PMU test"
    os.system(
Exemple #2
0
 # Grove I2C test
 # print "Grove I2C test"        
 # os.system("echo \"----------------------------Grove I2C test----------------------------\n\" >> " + report_file)
 # if pins.check_i2c() == 'ok':   
     # oled.myPrint("I2C TEST", "OK")                 
     # os.system("echo \"Grove I2C test   ------>[pass]\n\n\" >> " + report_file)
 # else:    
     # oled.myPrint("I2C TEST", "Fail")                  
     # os.system("echo \"Grove I2C test   ------>[fail]\n\n\" >> " + report_file)
     # report_error()
     
 
 # analog pins test
 print "analog pins test"        
 os.system("echo \"----------------------------analog pins test---------------------------\n\" >> " + report_file)
 status,result = pins.check_voltage()
 for v in result:            
     os.system("echo \""+ v + "\n\" >> " + report_file)
 if status == 'ok':   
     oled.myPrint("ANALOG", "OK")         
     os.system("echo \"analog pins test   ------>[pass]\n\n\" >> " + report_file)
 else:  
     oled.myPrint("ANALOG", "Fail")          
     os.system("echo \"analog pins test   ------>[fail]\n\n\" >> " + report_file)
     report_error()
 
 
 # PMU test
 print "PMU test"        
 os.system("echo \"----------------------------PMU test---------------------------\n\" >> " + report_file)
 status,result = pins.check_power()
#!/usr/bin/env python
import Adafruit_BBIO.GPIO as GPIO
import time
import os
import pins
if __name__ == "__main__":
   status,rt = pins.check_voltage()
   if status == 'ok':
      for v in rt:
         print v

   print pins.check_io()

   status,rt = pins.check_power()
   print  status
   if status == 'ok':
      for v1 in rt:
         print v1
#!/usr/bin/env python
import Adafruit_BBIO.GPIO as GPIO
import time
import os
import pins
if __name__ == "__main__":
    status, rt = pins.check_voltage()
    if status == 'ok':
        for v in rt:
            print v

    print pins.check_io()

    status, rt = pins.check_power()
    print status
    if status == 'ok':
        for v1 in rt:
            print v1