[Swansea Hackspace] Re: Hackspace Digest, Vol 6, Issue 9

Justin Mitchell justin at discordia.org.uk
Sun Jun 23 20:33:31 BST 2013


On Sun, 2013-06-23 at 19:14 +0100, Tim Moore wrote:
> Slowly getting it together on the Pic demo program.  I've retyped the
> source and have this:-
> 
>  * File:   cointoss5.c
>  * Author: Tim
>  *
>  * Created on 20 June 2013, 07:51
>  */
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <xc.h>
> #include <pic12f1840.h>
> 
> #define INT_OSC 500000L
> #define _XTAL_FREQ _INT_OSC
> 
> /* 12.0 page 101 setup the ports 
>  */
> 
> TRISAbits.TRISA0 = 0;
> TRISAbits.TRISA1 = 0;
> TRISAbits.TRISA2 = 1;
> 


I guess your not experienced with C programming then, and of course you
wern't up to speed in the workshop to get help with this part because of
your laptop problems.

The port setup code goes inside the main() function.

I have added the completed C code to the downloads on the meetings page
on the website, you can see what it is meant to look like.





More information about the Hackspace mailing list