About Flex sensor interfacing with AVR microcontroller.

sachini Amarasinghe's picture

Offline

Joined: Nov 15, 2020

Replies: 2
About Flex sensor interfacing with AVR microcontroller.
November 15, 2020 - 4:48pm

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?

 

Debashis Das's picture

Offline

Joined: Dec 02, 2019

Replies: 113

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 

sachini Amarasinghe's picture

Offline

Joined: Nov 15, 2020

Replies: 2

Thank you for your reply Debashis Das!

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 585

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.

sachini Amarasinghe's picture

Offline

Joined: Nov 15, 2020

Replies: 2

Thank you @Sourav Gupta!

Shivani Mane's picture

Offline

Joined: Nov 28, 2020

Replies: 1

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.

Debashis Das's picture

Offline

Joined: Dec 02, 2019

Replies: 113

Hi Shivani, can you please provide the code?

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 585

Install the onewire.h lib in the environment.