Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m confused

Run problem

Having trouble with adc_test.py run. Getting multible problems. File not found, bad file descripter ect.... Pg 307 in the Raspberry Pi Cookbook help sbob21@y a h o o.c o m
1 person has
this problem
+1
Reply
  • Hello Bob,

    I have forwarded your question on to our Book Tech staff, so they can help you find a solution. If you ever have any questions or issues with the content of a title, you can also contact them directly at booktech@oreilly.com or call them at:

    1-800-889-8969
    or
    1-707-827-7019 (outside the USA)
    7:30 am to 5:00 PST

    Best regards,
    Paul
    O'Reilly Media
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Bob,

    Can you give us the full error messages that you are getting? Those error message provide clues about what is causing the problem.
    If you are getting a "file not found", something is missing.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • TY Chris for the fast reply, this is the latise error I'm getting:

    Traceback (most recent call last):
    File "adc_test.py", line 12, in
    reading = analog_read(0)
    File "adc_test.py", line 7, in analog_read
    r = spi.xfer2([1, (8 + channel) << 4, 0])
    IOError: [Errno 9] Bad file descriptor

    I copied program off the web. Other programs run ok?
    It's looks almost like the file spi.open(0, 0) is missing, from another error I was getting. Strange!
    Thanks again........
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Bob,

    Sorry for the delay in responding.

    That still doesn't seem like the full error message, but I'll take a shot at this...

    You said:
    "It's looks almost like the file spi.open(0, 0) is missing, from another error I was getting. Strange!"

    Make sure you have followed the directions on the top of that page 309, where it says:
    Before trying the program, make sure you have SPI enabled and the SPI Python library installed (Recipe 8.6).

    If that isn't the cause of the problem, please include the complete error message that you are getting whey you run the program.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated