- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am new to the psoc product. I'm trying to use a distance sensor. The firmware does not work as it should and I do not know if it is the fault of a faulty sensor or software errors. The sensor is connect correctly (the pins are exactly the same as in the psoc wizard). The sensor shows a random value and does not refresh it until I lift the object (large cardboard) above the sensor, I put it in another place in the plug, a different value is displayed, not similar to the real one. Can someone please help me?
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The trigger pulse must be very short (~ 10 microseconds):
............................
for(;;)
{
/* Place your application code here. */
// while(echo_Read() == 0 )
// {
Trigger_out_Write(1);
CyDelayUs(10u); // positive Trigger pulse time 10 microseconds
Trigger_out_Write(0);
CyDelay(1); // waiting for sending 8 pulses (0,5 mSec)
// }
while(echo_Read() == 1){};
...............................
On this forum you will find many examples of working with the HC-SRO4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The trigger pulse must be very short (~ 10 microseconds):
............................
for(;;)
{
/* Place your application code here. */
// while(echo_Read() == 0 )
// {
Trigger_out_Write(1);
CyDelayUs(10u); // positive Trigger pulse time 10 microseconds
Trigger_out_Write(0);
CyDelay(1); // waiting for sending 8 pulses (0,5 mSec)
// }
while(echo_Read() == 1){};
...............................
On this forum you will find many examples of working with the HC-SRO4.