CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Simple question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bauche



Joined: 06 Nov 2010
Posts: 22
Location: montreal qc

View user's profile Send private message Send e-mail

Simple question
PostPosted: Sat Apr 09, 2011 4:40 am     Reply with quote

i'm using 16f628a
i'm trying to do: a led goes on when you push a button and when you push the same button goes off

Thanks for help!!!
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Apr 09, 2011 5:40 am     Reply with quote

try googling 'PIC pushbutton LED C code' can't me more than 100,000 hits
very simple hardware and code required.4 parts, 20 lines of code.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sat Apr 09, 2011 6:11 am     Reply with quote

You might also try looking up what a "state machine" is. You are making a very simple state machine.

http://en.wikipedia.org/wiki/Finite-state_machine
_________________
The search for better is endless. Instead simply find very good and get the job done.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 09, 2011 2:31 pm     Reply with quote

LED on/off code:
http://www.ccsinfo.com/forum/viewtopic.php?t=31432
http://www.ccsinfo.com/forum/viewtopic.php?t=45036

Switch debouncing code:
http://www.ccsinfo.com/forum/viewtopic.php?t=19874
http://www.ccsinfo.com/forum/viewtopic.php?t=23837
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group