SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By wpongp
#83198
Hi, I am new to Arduino and just bought a 7 segment serial display this week. http://www.sparkfun.com/commerce/produc ... ts_id=9230

Instead of using SPI, I would like to use TTL level communication to control my display and my arduino is ATMega328. The wiring is easy, VCC to pin11, GND to GND and RX to TX(arduino).

I was told to use Serial.write() to display numbers but not succeed yet.

After hours of struggling, I'd like to ask your kindly help to help me with the coding. At this first stage, I just want to display four digits mannually.

Below is my code now:

Void Setup(){
Serial.begin(9600);

pinMode(11, OUTPUT);
}


Void loop(){

Serial.write(0x02);
Serial.write(0x03);
Serial.write(0x04);
Serial.write(0x05);

}

I really have no idea with my coding.
Thank you in advance!
By JimEli
#83556
...
Last edited by JimEli on Fri Jan 14, 2011 8:04 am, edited 1 time in total.
By leunghoming
#85990
I am also new user of 7 segment serial display just bought on last week, I will try to use PC's RS232 port to connect the display and program by VB.Net.
Its always indicate "0000", did you have any sample code for me to work with the 7 segment serial LED display?
My VB.Net code as follows:
Code: Select all
Imports System.IO.Ports
Imports System.Text

Public Class frmMain
    Dim RS232 As SerialPort
    
    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RS232 = New IO.Ports.SerialPort("COM1", 9600, 0, 8, 1)
        RS232.Open()
    End Sub

    Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If RS232 Is Nothing OrElse Not RS232.IsOpen Then
            Exit Sub
        End If
        RS232.Close()
        RS232 = Nothing
    End Sub

    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Dim xmtSend() As Byte = {&H31, &H32, &H33, &H34}
        RS232.Write(xmtSend, 0, xmtSend.Length)
    End Sub
End Class