ds18b20 and CY8CKIT-049-41

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello!
I'm new in programming using PSoC. I need a help!
How I can connect my dallas temperature sensor ds18b20 using 1-wire bus to my psoc 4 cy8ckit-049 prototyping kit?

0 Likes
11 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

How to import components -

   

 

   

http://www.cypress.com/resource-types/video/psoc-creator-tutorial-importing-components

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I import component, but there is two errors in OneWire.h
1) operator "defined" requires an identifier
2) missing binary operator before token "$INSTANCE_NAME"

   

in lines:
#if !defined(`$INSTANCE_NAME`_H) 
#define `$INSTANCE_NAME`_H

   


What's wrong? Maybe I doing something wrong or don't include some needed file?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Replace

   

#if !defined(`$INSTANCE_NAME`_H) 

   

with

   

#ifndef(`$INSTANCE_NAME`_H) 

   

 

   

I cannot tell which version of the C-compiler accepts the first writing (if any). Please check that you are using Creator 3.2

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Bob, I replaced, but now there is another error: macro names must be identifiers (In line: #ifndef (`$INSTANCE_NAME`_H) )
Yes, I'm using Creator 3.2

   


Taras

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Something's wrong:

   

The file containing your #ifs is a template-file and should not be compiled as-it-is. Instead it is used to generate the appropriate .h file with the name of the component you placed onto the schematic.

   

Re-read the instructions for importing components and try again, do not copy those template-files to your project-directory.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Correct me please if I'm doing something wrong. I downloaded 1-wire component and export it like archive. After I import it in my project. I pun component using TopDesign In main.c I use function of this component. And there is mistake "undefined reference to `OneWire_Read8'". If I add "#include "OneWire.h"" in main.c I will have mistakes about which I wrote above. 
This way of programming is new for me and I don't understand what I doing wrong...


Taras

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The video showing how to import a component does not say anything about exporting as you said in your last post.

   
        
  • Download the component library
  •     
  • Open your project
  •     
  • Select "Components" tab in Workspace Explorer
  •     
  • Click "Project -> Import Component" select from Library
  •     
  • Navigate to the downloaded library and select the library file.
  •     
  • Import the component now
  •     
  • Select "Source" tab in Workspace Explorer
  •     
  • Select TopDesign
  •    
   

In the component catalog you will see a new tab named "Default" where you now will find the newly imported component which you now may place onto your schematic. You do not need (may not) #include any component files, that is done automatically.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Bob and Dana, thank you very much! I'll try to solve my problem.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome!

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Glad to have been of help.

   

 

   

Regards, Dana.

0 Likes