I have a question about how to use a potentiometer.
Everything works fine when using the usual code of " sensorValue = analogRead pot..... analogWrite(motor, outputValue)" on arduino nano board 16Mhz.
Now I have programmed an atmega328 chip at 8Mhz in order avoid using the external crystal on my circuit.
Everything works just fine except the potentiometer. It is only switched from low to high.
Dear Koepel, you just have opened my eyes. Due to the complexity of the circuitry I missconnected the output pin to D7 instead of D9 which is PWM output.
By the way, I got the same problem with other AVR microcontrollers like Attiny406 and the compatible arduino board MH-Tiny.
I brogramming them through Arduino IDE with similar effect. I have tried all pins as inputs and outputs without any success.
MH-Tiny gives as digital PWM output the pins 9 and 10.
Stick with the official supported Arduino boards.
It depends on the MH-Tiny software core (the build environment with libraries) what it can do.
Is there a official website for the MH-Tiny ?
Does it have a software USB ? I would stay away from that.
Yeah, well they just droped in my hands so I give them a try. However, I am really in interested of use other microcontrollers more than the Attiny85. Atmega328 are hard to find so I am in a need of other compatible and easy to find microcontrollers. Attiny406 and other similar to that are really easy to get programmed through Arduino IDE by UPDI method. But I am always in a luck with the potentiometer map reading.