week4
Cobox communication
09/28 I finally got numbers on hyperterminal screen through a server, I want to keep how I did it. At first, I found that the configuration I set up last week was wrong. Because I need to use the last 3 digits of my IP address(128.122.151.108), which is given to me, into the remote port number. And in the telnet stage screen I need to put 'java CoboxServer 10108'. That is a clue for talking! Then I want to make my circuit talk through server to make my LEDs light up. But I found it needs many things to think about, because I have to modify my BX24 code. I tried to do it, but I realized that I could receive valus from cobox, And I need to know how to communicate using serial input. It looks not so easy for now. I am going to put more time on this. |
09/28/03 I am trying to modify Tom's code below a little bit to make 7LEDs light up. '
set up input and output buffers in memory: '
variables for dealing with incoming serial data: '
strings for sending out through the CoBox: '
variables for dealing with the ADC: '
constants for the serial port and the ADC: Sub main() call delay(1.0) ' start program with a half-second delay
' set up serial port:
' open the input and output buffers:
' main loop:
' check for incoming serial data:
' If there is data in the input buffer,
if (gotaByte = true) then sub
parseCharacter()
' convert the ascii value of 0-9 to a numeric value if
(dataByte>=0) and (dataByte < 25) '
iterate over the pins, turn on the one asked for, '
if we get "9", send the ADC message. sub
sendADCval() ---------------------------------------------- related page of this code is here. '******Tom Igoe's BX code to make 7 LEDs light up.********** 'Byte
value sent LED lit '
set up input and output buffers in memory: '
variables for dealing with incoming serial data: '
strings for sending out through the CoBox: '
variables for dealing with the ADC: '
constants for the serial port and the ADC: Sub main() call delay(1.0) ' start program with a half-second delay
' set up serial port:
' open the input and output buffers:
' main loop:
' check for incoming serial data:
' If there is data in the input buffer,
if (gotaByte = true) then sub
parseCharacter()
' convert the ascii value of 0-9 to a numeric value '
iterate over the pins, turn on the one asked for, '
if we get "9", send the ADC message. sub
sendADCval() ------------------------------------------------------- '
set up input and output buffers in memory: '
variables for dealing with incoming serial data: '
strings for sending out through the CoBox: '
variables for dealing with the ADC: '
constants for the serial port and the ADC: Sub main() call delay(1.0) ' start program with a half-second delay '
set up serial port:
' open the input and output buffers:
' main loop:12
loop sub
sendADCval() sub
receiveADCval() |