Hi Tina10, welcome to the forum.
Here, totally untested, try this:
Code:define NO_CLRWDT 1 define OSC 4 ' OSCCON defaults to 4MHz on reset Include "modedefs.bas" @ __CONFIG _IntRC_OSC & _WDT_OFF &_MCLRE_OFF & _CP_OFF trisio = %00011111 MyVar var byte index var byte mainloop: ' alias ports to a variable myvar = gpio MyVar.0 = gpio.0 MyVar.1 = gpio.1 Myvar.2 = gpio.2 MyVar.3 = gpio.3 MyVar.4 = 0 ' zero the upper 1/2 byte MyVar.5 = 0 MyVar.6 = 0 MyVar.7 = 0 'convert binary port value to ascii representation of the numbers lookup myvar,["0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"]index 'send out port 5 serially Serout gpio.5,T2400,[254,128,index] goto mainloop




Bookmarks