Well I decided to revisit this project but make it from a Basic language using Proton Basic, Proton Basic uses some of the more baseline Microchips like the 12F, 16F PICs. maybe we can convert Stacy to the Basic language now, hey Brad?! hehe!.
For this im going to use the 12F675 8pin microchip, and the RSIn and RSOut commands from the Proton Basic language.
heres an example of the Transmitter code I have so far:
Code: Select all
Device = 12F675
Xtal = 4
' Set ext 4mhz crystal
Config FOSC_XT, CPD_OFF, CP_OFF, BODEN_OFF, MCLRE_OFF, PWRTE_ON, WDT_OFF
All_Digital = TRUE ' set CMCON = 7
INTCON = 0 ' Disable Interrupts
'-------[DECLARE SERIAL DATA]--------------------------------------------
Declare Rsout_Pin GPIO.2 ' Assigns the Port and Pin that will be used to Output serial data.
Declare Rsout_Mode 0 ' Sets the serial mode.
Declare Serial_Baud 1200 ' Baud Rate to receive and transmit data.
Declare Rsout_Pace 10 ' Delay between characters transmitted by the Rsout command.
'-------[ASSIGN PINS]----------------------------------------------------
Symbol Led = GPIO.0
Symbol btn1 = GPIO.1
'-------[ASSIGN GENERAL VARIABLES]---------------------------------------
Dim byteOut As Byte
Dim looop As Byte
'-------[INITIALISE THE PICMICRO]----------------------------------------
TRISIO = %111010 ' Set pin functions (Input/Output)
Output Led
Low Led
Input btn1
' Init variables
byteOut = 1
DelayMS 100 ' Wait for the PICmicro to stabilise
'-------[MAIN PROGRAM LOOP STARTS HERE]----------------------------------
While 1 = 1 ' Create an infinite loop
' check if button pressed
If btn1 = 0 Then
High Led
RSOut Bin 43690
For looop = 0 To 2
RSOut "Z" , Dec byteOut, 13
Next
DelayMS 500
Low Led
EndIf
Wend ' Loop prog