I have collected Accel data and send them via Radio to computer,but how can I 
display them in Oscilloscope??
     I am a new learner??I don't know much about python??I tried change 
Oscilloscope.py like this??
import sys
import tos


 AM_ACCELRADIOMSG=6


class AccelRadioMsg(tos.Packet):
    def __init__(self, packet = None):
        tos.Packet.__init__(self,
                            [('dataX',    'int', 2)
                             ('dataY',    'int', 2)
                             ('dataZ',    'int', 2)  
                             ('count',    'int', 2),
                             ('readings', 'blob', None)],
                            packet)


if '-h' in sys.argv:
    print "Usage:", sys.argv[0], "serial@/dev/ttyUSB0:115200"
    sys.exit()


am = tos.AM()


while True:
    p = am.read()
    if p and p.type == AM_ACCELRADIOMSG:
        msg = OscilloscopeMsg(p.data)
        print msg.dataX, msg.count  [i<<8 | j for (i,j) in 
zip(msg.readings[::2], msg.readings[1::2])]
        print msg.dataY, msg.count  [i<<8 | j for (i,j) in 
zip(msg.readings[::2], msg.readings[1::2])]
        print msg.dataZ, msg.count  [i<<8 | j for (i,j) in 
zip(msg.readings[::2], msg.readings[1::2])]
 
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
but it doesn't work??????????
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to