# Serial Port EEGbiosemi

**URL:** <https://discourse.psychopy.org/t/serial-port-eegbiosemi/23020>\
**Category:** Builder\
**Created:** [May 16, 2021, 4:33pm UTC](https://discourse.psychopy.org/t/serial-port-eegbiosemi/23020 "2021-05-16T16:33:11Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![Stephanie\_Aedo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/stephanie_aedo/32/11420_2.png) [@Stephanie\_Aedo](https://discourse.psychopy.org/u/Stephanie_Aedo)\
**Post date:** [May 21, 2021, 10:50pm UTC](https://discourse.psychopy.org/t/serial-port-eegbiosemi/23020/25 "2021-05-21T22:50:45Z")

</div>

Hi Becca,  
So, to sum up, the new code  
port.write(1) does not work.

I ended up adding this port.write(str.encode(chr(trigger))) codeand all of the 80 words are recorded. but still, sometimes i get 204 as a trigger. with this script my triggers are the same as in the excell file.  
port.write(trigger)  
if trigger ==1:  
port.write(1)  
elif trigger ==2:  
port.write(2)  
elif trigger ==3:  
port.write(3)  
port.write(str.encode(chr(trigger)))

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/4/b47365c7bb046a42a01698f6191422f3cd122a70.png)

---

_[View the full topic](https://discourse.psychopy.org/t/serial-port-eegbiosemi/23020)._
