Uno sketch to ATTINY85

I have a sketch that work perfect on a Uno. How can I make it work on a ATTINY85. I just started playing with a Digispark ATTINY85 and just want to know if I can get it work without rewriting a whole new sketch. It's a simple input output and the Uno is way to much for this simple sketch.

DavidL-prj4.ino (2.77 KB)

JC_Button.cpp (3.35 KB)

JC_Button.h (3.05 KB)

Have you tried it yet? There's nothing glaringly evident from looking at your code that suggests it won't compile for the Tiny, except maybe foe its size. The other issue may surface in that the Tiny has only one GPIO port with 6 exposed pins (PB0 - PB5) that are heavily multiplexed for additional functions. Be careful you're not trying to use the same pin for two or more different things at the same time. Also, when porting your code, double check you port/pin assignments.

I have tried it and it does not work. Any suggestions for file size? It's big and I don't know how to make it smaller to fit onto ATTINY85.

How big is big? It would be useful, rather than abstract discussion, to actually see the messages returned by the compiler.

The 85 has 8K flash which is more than enough for that code. Without seeing the errors we're tilting at windmills.

well i tried it out and it works on half the board. output P0 with input P2,P3 works perfect but, output P1 with input P4,P5 is not working. also P0,P2,P3 only works when P1 is active. P1 active when power up. i'd tried this sketch on a Nano and it works perfect like the Uno board.

For whatever reason you don't want to post error messages, that's your business. I don't have time to debug your code from scratch so, good luck.

I don't understand error message. I didn't get any during uploading sketch. Everything upload fine i think as i didn't see any error messages. I'm just merely posting what i observed on the bench.