1 Attachment(s)
How to use Arrays Using Pic Basic Pro(need help)
Hi, everybody New to the forum just wanted to give a shout out to everyone before I proceed.
Problem: I Can not figure out how to use arrays with Pic Basic Pro
Need: my design revolves around witlessly transferring data over the air on to a receiving unit which will then display the incoming message. Currently my program simply displays the message as it is being typed in. However I would like to store the message in an array of lets say of 48 elements in a single dimension just a single row. I would then like to send the data that is being pressed on the keypad and have it stored in an element of the array after which it will then increment to the next position or next element for the next input.
What I have Tried: I tried declaring the array by doing the fallowing
htxt var word[48]
and when I try to use it after declaring it
htxt[0] = htxt[x]
temp[x] = htxt[x]
and when a keypad key is pressed
temp[x] = #key
serout.1200.PORTD.0, [temp[x]]
pause 100
temp[x] = htxt[x] + 1
when i use the fallowing method my receiving unit simply displays a blank message when ever the data is transmitted. The way I send data is after the message has been inputed and stored I then send each element by itself to the receiving unit so that I can loop the message since theres more than one receiving unit and this way if one unit is turned on after the first unit it will receive the data one the next cycle of the loop.
*****UPDATE******
I have uploaded my code but please understand that it does not contain the portion above simply because I could not get it to work so I used my old method to get the software working. I uploaded it so people will understand that I am using PIC Basic Pro