GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Dec-2012, 00:55
ApacheOmega ApacheOmega is offline
New Member
 
Join Date: Dec 2012
Location: Huntsville, AL.
Posts: 1
ApacheOmega is on a distinguished road

Trying to create a program that takes input from a sensor and outputs to LED


I'm writing an assembly program that will read information from a sensor that will detect whether its raining or not. the sensor will be the input and the LED will be the output indicating that its raining.
I have code written for 5 other weather conditions but right now I just want to figure out the most basic which is rain.

here's my code///////////////////////////I just want to know if I'm headed in the right direction, If not do you have any suggestions///////////////////
Code:
#include <p16F690.inc> ;---------------------------- ;define equates here ;---------------------------- count equ 0x00 sum equ 0x09 rainLed equ 4 rainSensor 10 dayOrNightLed equ 3 dayOrNightSensor 9 windLed equ 2 windSensor 8 snowLed equ 1 snowSensor 7 tempLed equ 0 tempSensor 6 fogLed equ 0 foqSensor 5 ;--------------------------- ;start of program ;--------------------------- org 0x0000 ; tells program to start at first location start: BSF status, RP0 ; select bank 1 BCF status RP1 movlw b'11111000' ; make bank 5-10 inputs movwf TRISA ;make bank 4-0 output BCF status RP0 ;bit clear file BCF status RP1 ;------------------------------ ;Loop ;----------------------------- BTFSS PortA, rainSensor BSF PortA,rainLed
is this part right so far?????????????????
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:21.


vBulletin, Copyright © 2000 - 2017, Jelsoft Enterprises Ltd.