discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] usrp_basic and gr_block


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] usrp_basic and gr_block
Date: Sun, 18 Jun 2006 18:21:29 -0700
User-agent: Mutt/1.5.9i

On Sun, Jun 18, 2006 at 06:34:19PM -0500, Michael Ford wrote:
> This is all well for functions found in usrp.py, but even though I import
> usrp.py, and usrp.py successfully imports usrp1.py, I'm unable to
> successfully call functions from usrp1.py (i.e. read_aux_adc()). Calling the
> function with either a usrp- or usrp1- prefix gives me an error of the
> module not having a read_aux_adc attribute.


After creating an instance of the usrp object use the object, 
not the class.   You want to invoke a method of the object.

    address@hidden tmp]$ python
    Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
    [GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from gnuradio import usrp
    >>> u = usrp.source_c(0, 64)
    >>> v = u.read_aux_adc(0, 0)
    >>> print v
    224

You might want to spend a bit of time with the python tutorial at
http://www.python.org/doc 

I prefer the pdf formatted version available here:
http://docs.python.org/download.html

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]