Hi buddy! I am trying programming from arduino to attiny85 via arduino as ISP using newest version of arduino tiny core. I attemped to read analog value from connected button. (Reason for this is that I connect 2 buttons via one analog pin-each button has different resistor attached to it, allowing me to know which button is pressed by reading analog value. So I have to do initial calibration) BUT! When my Attiny attemps to read the value, it showed gibberish in the serial monitor.
Thank you so much!
groundFungus:
Please post a schematic and the Uno (receiver) code. Does the serial monitor baud rate match the Uno baud rate?
From the Attiny core docs.
You might want to look at the serial support section on that page, too.
Thank you for helping!
I tried analogRead(A3) instead of analogRead(3), but still gibberish(pls see attachment screenshot).
And I struggled to draw the scheme, please see attachment Attiny_button_serial_com.
I was following the youtuber Video when I did this project.
HA! I just looked at the schematic (it's not called a scheme) and I can't figure out why the tiny is even in there. Why not just do all of that on the uno?
I agree that the scheme looks shabby.╮(╯▽╰)╭
I think I can simplify it later this evening and get it uploaded then.
My goal is to set up a project only using Tiny85 as microcontroller. The reason for connecting UNO is that-- I think UNO only works as a usb/serial converter. Otherwise I have no solution to conect Tiny85 directly to USB port.
ChrisTenone:
HA! I just looked at the schematic (it's not called a scheme) and I can't figure out why the tiny is even in there. Why not just do all of that on the uno?
I just want to transmit from the tiny85.
I updated the circuit scheme in the attachment(notice that "pullup" resistor is a mistake, it should be labelled as pulldown instead.).
The sketches below was uploaded to Attiny85 beforehand.
Then I connected as the scheme shows. Reset and GND on UNO were short by jumpwire.
groundFungus:
Is the communication 2 way or do you want to just transmit from the tiny85?
If I keep pressing button S2, on the serial monitor I can see " LC Lc 5 LC 5 C l H LC" or so.
As ChrisTenone pointed out, I changed the pins as described below to avoid using P5 and P0.
I tried setting P2 as RX, P1 as TX, P3 as button input, P4 as LED. Unfortunately the same stuff showed on monitor.