For example, I am running the next code which is checking ADC.
The code is right, there are no errors. I tried to run on other computer and it was fine.
The script does a loop with the following operations:
measures the ADC value at the ADC_IN1 pin, by issuing AT#ADC and AT#ADC=1,2,
then using GPIO.getADC, then prints the result on the debug port, sleeps for
0,5 sec
(the permitted Vmax of the input is 2V)
Expand|Select|Wrap|Line Numbers
- import MDM
- import MOD
- import GPIO
- MDM.send("AT#ADC\r", 5)
- a = MDM.receive(20)
- print "AT#ADC:%s\r" % a
- print 'sleep 0,5 seconds\r'
- MOD.sleep(5)
- trial = 0
- while (1 == 1):
- trial = trial + 1
- print 'loop %d:\r' % trial
- MDM.send("AT#ADC=1,2\r", 5)
- a = MDM.receive(20)
- print "\tAT#ADC=1,2 --> %s\r" % a
- mv = GPIO.getADC(1)
- print "GPIO.getADC(1) --> %d mV\r" % mv
- print 'sleep 0,2 seconds\r'
- MOD.sleep(2)
The error I get :
Traceback (innermost last):
File "C:\Program Files\Python\Pythonwin\pywin\framework\scriptutils .py", line 301, in RunScript
exec codeObject in __main__.__dict__
File "C:\Program Files\Python\Examples\ADC_test.py", line 39, in ?
MDM.send("AT#ADC\r", 5)
AttributeError: send
I have to say that all of the codes that i tried to run with the "send" command, i always get this error!