Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 86359
0 votes
1 answer
1k views

How to properly read ADC on an ATtiny85? [closed]

I use Vcc as reference value for the ADC. The problem I have: no matter what I do I always read the same value on the ADC. … bit 2 (1 << MUX1) | // use ADC2 for input (PB4), MUX bit 1 (0 << MUX0); // use ADC2 for input (PB4), MUX bit 0 ADCSRA = (1 << ADEN) | // Enable ADC
boop's user avatar
  • 191
1 vote
Accepted

How to properly read ADC on an ATtiny85?

>= 196 && adcValue <= 206) { // 27k ohm (2.6V -> adc 201) } else if (adcValue >= 181 && adcValue <= 191) { // 38k ohm (2.4V -> adc 186) } else if (adcValue >= 165 && adcValue <= 175) { // 50k ohm … (2.2V -> adc 170) } else if (adcValue >= 150 && adcValue <= 160) { // 65k ohm (2.0V -> adc 155) } Here is a picture of my breadboard. …
boop's user avatar
  • 191
1 vote
1 answer
203 views

Microcontroller freezes when triggering the gate of an N-channel MOSFET

The microcontroller can distinguish them by reading the ADC value. … (PB4), MUX bit 2 (1 << MUX1) | // use ADC2 for input (PB4), MUX bit 1 (0 << MUX0); // use ADC2 for input (PB4), MUX bit 0 ADCSRA = (1 << ADEN) | // Enable ADC
boop's user avatar
  • 191
1 vote

Microcontroller freezes when triggering the gate of an N-channel MOSFET

2.6V -> adc 201) playTrack(3); } else if (adcValue >= 181 && adcValue <= 191) { // 38k ohm (2.4V -> adc 186) playTrack(4); } else if (adcValue >= 165 && adcValue <= 175) { / … / 50k ohm (2.2V -> adc 170) playTrack(5); } else if (adcValue >= 150 && adcValue <= 160) { // 65k ohm (2.0V -> adc 155) playTrack(6); } // ending up here every loop where no button …
boop's user avatar
  • 191