- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm working on useing a color sensor TCS3200, and first i wanted to know how it worked. So i used an arduino and tested in there because there is alot of help on the internet. Now i want to try to make it on PSoC creator. One thing i came across here is that on arduino they use a "map" function witch takes the value of a variable and converts it to a new range og values, like from 0 to 255. How can i make somthing like this on PSoC creator? is there already a funciton i dont know about?
Regards Mads
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mads,
We do not have any such function by default, but you can implement the function yourself as already suggested. I tested your project and the UART is working. Make sure you have the right configurations set for the serial terminal. Since you are using the stdio and stdint libraries, which take up a lot of memory, increase both the stack size and the heap size.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also have another problem with my code (code is attached). I'm trying to read the frequence from my color sensor, and then print out the values. but my UART can't print in terminal window for some reason?
the reason why i set pins from high to low is for exaple: setting for RED (R) filtered photodiodes to be read (just to understand why i do what i do)
But the only thing i want, is to have my UART printing the different frequence of RGB.
Best regard Mads
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you want to use printf() with floating point, you need to increase the memory settings for your project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean incease the stack or heep size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mads,
We do not have any such function by default, but you can implement the function yourself as already suggested. I tested your project and the UART is working. Make sure you have the right configurations set for the serial terminal. Since you are using the stdio and stdint libraries, which take up a lot of memory, increase both the stack size and the heap size.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content