About Flex sensor interfacing with AVR microcontroller.

The code in " Flex sensor interfacing with AVR microcontroller" article is not working in atmel studio when I copy paste and run the code.Can we use the code in the  "Flex sensor interfacing with AVR microcontroller" article for the atmega 32 and if we can use it, how should we edit the code for atmega 32?

 

Ther is a lot of things you need to do before it can be ported for atmega32. the problem is in this (1<<ADFR) Specific instruction, it tells the ADC to run in Free Running Mode. if you want to port this to atmega32 you have to remove this instruction and put somthing that is supported by atmega32 

  Joined December 02, 2019      117
Monday at 10:02 PM

Thank you for your reply Debashis Das!

  Joined November 15, 2020      2
Sunday at 04:37 PM

As debasish said, find out the required library. Best way is to know the registers that are used in the project and configuring them in the Atmega32 individually, then turning the whole logic for atmega32.

  Joined February 12, 2018      696
Monday at 02:11 PM

Thank you @Sourav Gupta!

  Joined November 15, 2020      2
Sunday at 04:37 PM

Arduino: 1.8.8 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

soilcode:2:21: error: OneWire.h: No such file or directory

#include

^

compilation terminated.

exit status 1
OneWire.h: No such file or directory

This is the error in code please solve the error asap.

  Joined November 28, 2020      1
Saturday at 10:50 AM

Hi Shivani, can you please provide the code?

  Joined December 02, 2019      117
Monday at 10:02 PM

Install the onewire.h lib in the environment.

  Joined February 12, 2018      696
Monday at 02:11 PM