示例#1
0
    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()
    for v in result:
        #report.write(v+'\n')
        os.system("echo \"" + v + "\n\" >> " + report_file)
    if status == 'ok':
        oled.myPrint("PMU", "   OK")
        os.system("echo \"PMU test   ------>[pass]\n\n\" >> " + report_file)
    else:
        oled.myPrint("PMU", "   Fail")
        os.system("echo \"PMU test   ------>[fail]\n\n\" >> " + report_file)
        report_error()

    # GPIO test
    print "GPIO test"
    os.system(
        "echo \"------------------------------ GPIO test------------------------------\n\" >> "
示例#2
0
 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()
 for v in result:
     #report.write(v+'\n')
     os.system("echo \"" + v + "\n\" >> " + report_file)
 if status == 'ok':  
     oled.myPrint("PMU", "   OK")          
     os.system("echo \"PMU test   ------>[pass]\n\n\" >> " + report_file)
 else:     
     oled.myPrint("PMU", "   Fail")       
     os.system("echo \"PMU test   ------>[fail]\n\n\" >> " + report_file)
     report_error()
 
 
 # GPIO test
 print "GPIO test"        
 os.system("echo \"------------------------------ GPIO test------------------------------\n\" >> " + report_file)
示例#3
0
#!/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
示例#4
0
#!/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