Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling for ATtiny85 #34

Closed
Shdwdrgn opened this issue Feb 7, 2018 · 4 comments
Closed

Compiling for ATtiny85 #34

Shdwdrgn opened this issue Feb 7, 2018 · 4 comments

Comments

@Shdwdrgn
Copy link

Shdwdrgn commented Feb 7, 2018

I am trying to compile the servo.ino example for an ATtiny85 board, however there seems to be no I2C support despite trying various libraries and board cores.

I have tried this on Arduino IDE 1.6.12 and 1.8.5. I have tried using attiny cores from the following:
https://github.com/SpenceKonde/ATTinyCore
https://github.com/damellis/attiny

I have attempted to compile this while including Wire.h, TinyWireM.h, and TinyWire.h (one at a time of course). TinyWire.h (available at https://github.com/lucullusTheOnly/TinyWire) seems to be the newest code and is supposed to provide the I2C library via attiny's USI interface. When I attempt to verify the code, I get the following error message:

Arduino: 1.6.12 (Linux), Board: "ATtiny25/45/85, Disabled, CPU, ATtiny85, 8 MHz (internal), B.O.D. Disabled"

Build options changed, rebuilding all
In file included from /home/arduino/projects/attiny/PCA9685_test/PCA9685_test.ino:2:0:
/home/arduino/arduino-1.6.12/libraries/Adafruit-PWM-Servo-Driver-Library-master/Adafruit_PWMServoDriver.h:53:35: error: expected ')' before '*' token
   Adafruit_PWMServoDriver(TwoWire *I2C, uint8_t addr = 0x40);
                                   ^
/home/arduino/arduino-1.6.12/libraries/Adafruit-PWM-Servo-Driver-Library-master/Adafruit_PWMServoDriver.h:63:3: error: 'TwoWire' does not name a type
   TwoWire *_i2c;
   ^
exit status 1
Error compiling for board ATtiny25/45/85.

The readme for this library states that it is compatible with the attiny85. Could someone please provide updated directions on what libraries are required together in order to compile the examples for this servo driver board?

@ladyada
Copy link
Member

ladyada commented Feb 7, 2018

it works if you use the Wire library we have in our Arduino trinket/gemma board support package

https://github.com/adafruit/Adafruit_Arduino_Boards/tree/master/libraries/Wire

that library implements both tinywire and plain wire at once

@ladyada ladyada closed this as completed Feb 7, 2018
@Shdwdrgn
Copy link
Author

Shdwdrgn commented Feb 7, 2018

As mentioned, I already tried the TinyWireM library, with the same results.

To clear things up I created a new copy of arduino-1.6.12. In the libraries folder I copied Adafruit-PWM-Servo-Driver-Library-master and TinyWireM-master, then started Arduino IDE. The board selected is ATtiny25/45/85 with an 8Mhz internal clock as shown in the paste above. From the examples folder I opened servo.ino and clicked the button to verify the code. It comes back in just a couple seconds with the same error as pasted above.

Because this is still the same version number as I was using before, my Arduino IDE has several different cores for attiny boards installed. I could remove them from the preferences pane if there is something else I should be using. Which core are you using? Have you installed anything else to allow the code to compile?

@ladyada
Copy link
Member

ladyada commented Feb 7, 2018

you dont want TinyWire, you want just our plain Wire which integrates TinyWireM, it works for our Arduino AVR board kit only! you'll have to do some hacking to add support for other boards. but we don't have a guide or tutorial on how to do so!

@Shdwdrgn
Copy link
Author

Shdwdrgn commented Feb 7, 2018

Thanks, I finally got it to compile under both the lilypad and gemma boards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants