# Are there any libraries available for C#?

**URL:** <https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296>\
**Category:** OpenMV Boards\
**Created:** [May 8, 2023, 6:37pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296 "2023-05-08T18:37:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssoh](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@ssoh](https://forums.openmv.io/u/ssoh)\
**Post date:** [May 8, 2023, 6:37pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/1 "2023-05-08T18:37:15Z")

</div>

I want to get barcode value or image from c# Winform not IDE.

Is there any dll or example code that can be used in C#?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 8, 2023, 6:37pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/2 "2023-05-08T18:37:48Z")

</div>

You just open a serial port and read what the camera is sending: [GitHub - openmv/openmv: OpenMV Camera Module](https://github.com/openmv/openmv#note-on-serial-port)

---

<div class="post-metadata">

**Author:** ![ssoh](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@ssoh](https://forums.openmv.io/u/ssoh)\
**Post date:** [May 9, 2023, 10:28am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/3 "2023-05-09T10:28:27Z")

</div>

I ran the example code “uart\_control.py”. There was a problem with broken strings during communication. Even after checking the baudrate several times, the string is broken. Is there any workaround?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 9, 2023, 5:52pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/4 "2023-05-09T17:52:14Z")

</div>

Need to update that example:

```auto
# UART Control
#
# This example shows how to use the serial port on your OpenMV Cam. Attach pin
# P4 to the serial input of a serial LCD screen to see "Hello World!" printed
# on the serial LCD display.

import time
from pyb import UART

# Always pass UART 3 for the UART number for your OpenMV Cam.
# The second argument is the UART baud rate. For a more advanced UART control
# example see the BLE-Shield driver.
uart = UART(3, 19200, timeout_char=1000)

while(True):
    uart.write("Hello World!\r")
    time.sleep_ms(1000)

```

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 9, 2023, 5:52pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/5 "2023-05-09T17:52:36Z")

</div>

Make sure to pass the timeout\_char argument as the UART driver tosses characters if they take too long by default.

---

<div class="post-metadata">

**Author:** ![ssoh](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@ssoh](https://forums.openmv.io/u/ssoh)\
**Post date:** [May 9, 2023, 11:55pm UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/6 "2023-05-09T23:55:02Z")

</div>

I’ve tried that and it still doesn’t work. I am using it by connecting it directly to pin 4 and pin 5 of the h7-plus. Or is the UART-USB Shield in singtown a must?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 10, 2023, 12:41am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/7 "2023-05-10T00:41:05Z")

</div>

Wait, sorry, I thought you were talking to the PC.

If so, you literally just print() a value. It will appear to whatever program opens the OpenMV Cam COM port.

The above code is for getting serial data from the I/O pins which is meant for hardware devices.

---

<div class="post-metadata">

**Author:** ![ssoh](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@ssoh](https://forums.openmv.io/u/ssoh)\
**Post date:** [May 10, 2023, 2:27am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/8 "2023-05-10T02:27:03Z")

</div>

I am following the link below.

[![](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/3/3108b43659f785c6460b6fe349f72ab7e48cb027.jpeg "SingTown - OpenMV Cam video tutorial 27 - Serial Port To Transfer Data") ](https://www.youtube.com/watch?v=0guNiR7ji1M)

The difference with the video is that I do not have the UART-USB Shield.

I connected pin 4, pin 5 and ground directly to the rs232 cable.

SingTown Serialport program displays broken string instead of “Hello World”.

I changed laptops and cables. But it didn’t work out.

I don’t know how to solve

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 10, 2023, 4:03am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/9 "2023-05-10T04:03:50Z")

</div>

You need an RS232 converter. The pins output TTL serial. It’s inverted and at the wrong voltage level to connect directly to a PCs RS232 port.

---

<div class="post-metadata">

**Author:** ![ssoh](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@ssoh](https://forums.openmv.io/u/ssoh)\
**Post date:** [May 10, 2023, 5:12am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/10 "2023-05-10T05:12:51Z")

</div>

The above mentioned (currently used) rs232 cable means “usb to rs232 cable” + “D-Sub connector”. Do I need a converter other than this one?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 10, 2023, 5:38am UTC](https://forums.openmv.io/t/are-there-any-libraries-available-for-c/8296/11 "2023-05-10T05:38:47Z")

</div>

Yeah, you want USB to TTL. It’s actually cheaper than full RS232.

Note, you might have damaged your camera by connecting the RS232 signals to the OpenMV Cam directly…. RS232 is like -6V to 6V which is beyond the absolute max specs on the chip.
