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 / Replies / made attempt at code and

made attempt at code and

|

Projects › Projects › digital thermometer with 8051 › made attempt at code and

January 12, 2012 at 4:22 pm #7023
Shane Culhane
Participant

made attempt at code and isis

 

 

#include <reg52.h>
 
#define upper 22
#define lower 17
#define ON 1
#define OFF 2
 
unsigned char a2d_val;
 
sbit fan = P2^0;
sbit heater = P2^1;
sbit start_con = P3^0;
sbit eoc = P3^7;
 
void delay_50 (void);
 
void main (void)
{
eoc = 1;
P1 = 0xFF;
fan = heater = OFF;
while (1)
{
start_con = 1;
start_con = 0;
while (eoc == 0)
{
}
a2d_val = P1;
if (a2d_val > upper)
{
fan = ON;
heater = OFF;
}
else if (a2d_val<lower)
{
fan = OFF;
heater = ON;
}
else 
{
fan = heater = OFF;
}
delay_50();
}
}
void delay_50 (void)
{
TMOD = 0x01;
TL0 = 0x60;
TH0 = 0x3c;
TF0 = 0;
TR0 = 1;
while (TF0 == 0)
{
}
TR0 = 0;
}
 
 
 
 
code worked i think but problems building it
 
 

RSS Recent Posts

  • Supply vs performance query February 7, 2026
  • wall transformer polarity February 7, 2026
  • Do i need a buffer? February 7, 2026
  • BPF February 7, 2026
  • Figgie International intercom 1998 era February 7, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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