Beauchamp:TMS: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 53: Line 53:


pin 5 --> pin 11  (ground)
pin 5 --> pin 11  (ground)
To send signals via serial port, you need to send ASCII strings of commands as defined in Magstim's manual. This involves calculating a checksum byte too which is calculated by adding all the bytes in the command, then inverting the first 8 bits bit by bit. For example a command "@050" which is to set the TMS power to 50% needs a checksum byte which can be calculated as amentioned above to be "*".
The signal can then be send using:
Serial.WriteString "@050*"
Or in some cases the checksum byte is not type-able (like a file separator
Dim arrData1(2) As Integer
arrData1(0) = &H45
arrData1(1) = &B01001010
arrData1(2) = &H70
Serial.WriteBytes arrData1




Navigation menu