EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / i want to change that programe written on MPLAB c language for PIC16F877(blind person navigation system)

i want to change that programe written on MPLAB c language for PIC16F877(blind person navigation system)

|

Microcontroller › PIC › i want to change that programe written on MPLAB c language for PIC16F877(blind person navigation system)

  • This topic has 3 replies, 1 voice, and was last updated 14 years, 1 month ago by ZOBI.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 30, 2011 at 2:03 pm #896
    ZOBI
    Participant

    This source code is made for blind person helping project using 4 ultrasonic range finder  SRF04,4 vibration motors and single PIC16F877 microcontroller

     

    when any obstacle come in front of SRF04 they sends signal to controler and controller vibrates motor

    but this source code is made in such a way that constant vibration is produce and i want to make the duty cycle of motors with respect to the distance ,means the closer the person goes to any obstacle the greater the vibration in motor,in that manner blind person could understand that he or she is closer to any obstacle

    here is the source code and circuit diagram at the end

    please can any buddy change that and make it according to the above method which i hav mentioned

     

    #include <16F877.h> //standard includes
    #include <stdio.h>
    #use delay(clock=20000000) // 20 MHz clock
    #define TOP_THRESHOLD 120 //define a threshold to determine near vs far, ie,
    object or no object, for the top sensor
    #define MID_THRESHOLD 140 //define a threshold to determine near vs far, ie,
    object or no object, for the middle sensors
    #define BOT_THRESHOLD 160 //define a threshold to determine near vs far, ie,
    object or no object, for the bottom sensor
    #define TIME_DELAY 30 //define a delay to wait while counting in order to
    undersample
    int time; //initliaze a variable to act as a counter
    //code to deliver trigger pulse to sensors
    void trigger() {
    output_high(PIN_B2);
    delay_us(12);
    output_low(PIN_B2);
    }
    void main() {
    while(true) {
    //PIN_A1
    time=0; //(re)set time to 0
    trigger();
    while(!input(PIN_A1)); //wait while the output of this sensor is low
    //then when it goes high, count how many cycles it is high for
    while(input(PIN_A1)) {
    delay_us(TIME_DELAY);
    time++;
    }
    //check time and take appropriate action, that is, vibrate or not
    if (time<=TOP_THRESHOLD) {
    output_high(PIN_C1);
    }
    else {
    output_low(PIN_C1);
    }
    //repeat for the other 3 sensors:
    //PIN_A2
    time=0;
    trigger();
    while(!input(PIN_A2));
    while(input(PIN_A2)) {
    delay_us(TIME_DELAY);
    time++;
    }
    if (time<=MID_THRESHOLD) {
    output_high(PIN_C2);
    }
    else {
    output_low(PIN_C2);
    }
    //PIN_A3
    time=0;
    trigger();
    while(!input(PIN_A3));
    while(input(PIN_A3)) {
    delay_us(TIME_DELAY);
    time++;
    }
    if (time<=MID_THRESHOLD) {
    output_high(PIN_C3);
    }
    else {
    output_low(PIN_C3);
    }
    //PIN_A4
    time=0;
    trigger();
    while(!input(PIN_A4));
    while(input(PIN_A4)) {
    delay_us(TIME_DELAY);
    time++;
    }
    if (time<=BOT_THRESHOLD) {
    output_high(PIN_D0);
    }
    else {
    output_low(PIN_D0);
    }
    delay_ms(3);
    }
    }

     

     

    May 2, 2011 at 1:58 pm #6073
    ZOBI
    Participant

    wysiwyg_imageupload:977:
     

    May 2, 2011 at 1:59 pm #6074
    ZOBI
    Participant

    hey yar

    where is every buddy plz help me out its  a simple code

    if any buddy can not make that source code which i hav asked on c language then make it on assembly but reply me

    May 5, 2011 at 6:44 am #6083
    ZOBI
    Participant

    i will change the circuit if its required but 1st i need some one to help me to change the source code which i have mentioned

    can u change it? i dont know the cammands which will be used to make it according to my thought

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • PIC KIT 3 not able to program dsPIC June 23, 2025
  • Fun with AI and swordfish basic June 23, 2025
  • Is AI making embedded software developers more productive? June 23, 2025
  • Microinverters and storeage batteries? June 22, 2025
  • FFC connector white June 22, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise