English
Language : 

TLE4201SI Datasheet, PDF (6/7 Pages) List of Unclassifed Manufacturers – TLE4201SI
// MotorbrueckemitButton.c
// Aigner Sebastian
// Mittwoch, 19. Februar 2003
#include "D:\Picc\Examples\16F877.H"
#fuses HS,NOPROTECT,NOWDT
#use delay(clock=20000000)
//#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
main()
{
int pressed=0;
// 0 for stopped both low
// 1 for forward PIN_D6-high PIN_D7-low
// 2 for backward PIN_D6-low PIN_D7-high
output_low(PIN_D6);
output_low(PIN_D7);
output_high(PIN_D5);
// set for
// motor stopped
// for h bridge command power
output_high(PIN_A3);
// set buttonpower high
set_tris_a(0b00000111); // set PIN_A2 PIN_A1 PIN_A0 to input
while (true)
{
if(input(PIN_A2) && pressed != 1)
{
if(pressed == 2)
{
output_low(PIN_D6);
output_low(PIN_D7);
delay_ms(500);
// 0,5 sec pause for motorstoping
// if running vice versa
}
output_high(PIN_D6);
output_low(PIN_D7);
pressed=1;
}
if(input(PIN_A1) && pressed != 0)
{
output_high(PIN_D6);
output_high(PIN_D7);
pressed=0;
}
if(input(PIN_A0) && pressed != 2)
{
if(pressed == 1)
{
output_low(PIN_D6);
output_low(PIN_D7);
delay_ms(500)
// 0,5 sec pause for motorstoping
// if running vice versa
}
output_low(PIN_D6);
output_high(PIN_D7);
pressed=2;
}
}
}
TLE 4201 SI
Aigner Sebastian
Samstag, 22. Februar 2003