bmp085 example code trouble

Breakout boards, sensors, Drawdio, Game of Life, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

bmp085 example code trouble

Postby jws302 » Wed Jan 23, 2013 12:41 pm

trying to implement the adafruit example code for the bmp085, first it didnt like the syntax of the print statements ( which i read in verision 3.2.3 of Python, has become a function. added parentheses, then came up with the error below.
>>>
Traceback (most recent call last):
File "/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_BMP085/Adafruit_BMP085_example.py", line 3, in <module>
from Adafruit_BMP085 import BMP085
File "/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_BMP085/Adafruit_BMP085.py", line 59
print "Invalid Mode: Using STANDARD by default"
^
SyntaxError: invalid syntax
>>>
i've done some coding in turbo pascal,gwbasic,vb6, delphi6 and just starting to learn python....a kick in the right direction would help.
thank you
jws
jws302
 
Posts: 2
Joined: Mon Jan 14, 2013 4:23 am

Re: bmp085 example code trouble

Postby adafruit_support_rick » Wed Jan 23, 2013 2:28 pm

Didn't you put the parentheses around the print statement?
Code: Select all
print( "Invalid Mode: Using STANDARD by default")
User avatar
adafruit_support_rick
 
Posts: 2907
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: bmp085 example code trouble

Postby jws302 » Thu Jan 24, 2013 11:37 am

went through and changed all instances of PRINT " " to PRINT (" ") this fixed all related error for PRINT. now have IOERROR, err syntax error.
guess i'll have to crash learn more python.
thanks for your help

i was using adafruits bmp085 code library as is. guess it needs a few tweeks since version B came out, plus says not tested yet.
jws302
 
Posts: 2
Joined: Mon Jan 14, 2013 4:23 am


Return to Other Adafruit products

Who is online

Users browsing this forum: arbj, mibignistinly and 5 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]