Displays commands plus a sample run of Softata Console App with Displays selection.

c# Console Softatalib App commands for Displays

App Start

SoftataLib.Init(ipaddressStr, port);
SoftataLib.SendMessageCmd("Begin")
string SoftataLib.SendMessageCmd("Version"); //Get Arduino app Version
string SoftataLib.SendMessageCmd("Devices"); // Get list of device types supported

Display Queries and Setup

string[] SoftataLib.Display.GetDisplays()
SoftataLib.Display.GetPins(displayIndex)
(byte) displayLinkedListIndex = SoftataLib.Display.SetupDefault(displayIndex)

Display Commands

SoftataLib.Display.Clear(displayLinkedListIndex)
SoftataLib.Display.SetCursor(displayLinkedListIndex, x,line)
SoftataLib.Display.WriteString(displayLinkedListIndex, stringMessage);
SoftataLib.Display.WriteString(displayLinkedListIndex, x, line, stringMessage)
Misc command TBA

Corresponding Arduino commands

  • 0xF1: Display type commands
    • Param is the Sensor subcommand:
      • 0x00 GetPins
      • 0x01 TBD
      • 0x02 SetupDefault
      • 0x03 Setup
      • 0x04 Clear
      • 0x05 Backlight
      • 0x06 SetCursor
        • x = otherData[1]
        • line = otherData[2]
      • 0x07 WriteString
        • String = from otherData[1]
      • 0x08 CursorWriteString
        • Cursor data[1] na data[2] as previous followed by
        • String data
      • 0x09 Misc
        • Data from otherData[2]
      • 0xFF GetSensors

LCD1602 Display.Misc Commands

Nb: Misc commands are display type specific

  • 0x01 home
  • 0x02 autoscroll
  • 0x03 noautoscroll
  • 0x04 blink
  • 0x05 noblink

Commands are sent to Arduino server from Softatalib as array of bytes:

  • Length of array
  • Display Command Class Type (0xF1)
  • Pin
  • Param: Subcommand
  • Other: Display Type / Display Linked List index
  • OtherData:
    • Array of additional data (Used by 2nd Setup method)
      • Default setup uses default settings
    • Misc commands otherData bytes
      • Length of bytes = 2
      • Misc command

Sample Console app output: Display

1. Main Menu

Hello from Soft-ata!

TESTS
1.              Digital
2.              Analog
3.              PWM
4.              Servo
5.              Sensors
6.              Displays
7.              Serial
8.              PotLightSoundAnalog
9.              USonicRange
10.             PotRelay
11.             PotServo

Please make a selection (Default is 1):6
Testtype: Displays

  • Option 5: Displays selected

2. Connect to Server

Connecting to Softata Server.
Socket created to 192.168.0.9:4242
Sending 2 data bytes
Sent 2 bytes
Received Ready [5] bytes

Sending 2 data bytes
Sent 2 bytes
Received 3.10 [4] bytes

Softata Version: 3.10
Sending 2 data bytes
Sent 2 bytes
Received DEVICES:sensor,actuator,communication,display [45] bytes

DEVICES:sensor,actuator,communication,display
  • Got Arduino app version and supported device types

3. Get Displays Types

Sending 3 data bytes
Sent 3 bytes
Received OK:Displays:OLED096,LCD1602,NEOPIXEL [36] bytes
  • List of displays implemented returned. Used in following menu:

4. Select Sensor

Displays found:
1.              OLED096
2.              LCD1602
3.              NEOPIXEL
Default: 1.
Nb: Option 1. not yet available.
Selection:2
  • Option 2: LCD1602 chosen

5. Get Dsplay connections

Sending 5 data bytes
Sent 5 bytes
Received OK:I2C0 (Pins8/9 (SDA/SCL) fixed): Addresses (LCD)0X3E and (RGB)0X62. Embedded in driver though. [96] bytes

LCD1602 getPins OK
LCD1602 Pins = I2C0 (Pins8/9 (SDA/SCL) fixed): Addresses (LCD)0X3E and (RGB)0X62. Embedded in driver though.
Press any key to continue..

  • I2C0 @ 0x34 and 0x62 Connection

6. Setup Display

Sending 5 data bytes
Sent 5 bytes
Received OK:0 [4] bytes

displayLinkedListIndex: 0
Instantiated LCD1602 linked at 0
  • LCD1802 Display setup OK
  • Display node index in Sensor Linked list is 0
    • Is passed to subsequent commands

7. Various LCD1602 Display.Misc Commands

Sending 5 data bytes
Sent 5 bytes
Received OK:Clear [8] bytes
  • Clear

Sending 8 data bytes
Sent 8 bytes
Received OK:SetCursor [12] bytes
  • SetCursor on first line
Sending 17 data bytes
Sent 17 bytes
Received OK:WriteString [14] bytes
  • WriteString at Cursor
Sending 8 data bytes
Sent 8 bytes
Received OK:SetCursor [12] bytes
  • SetCursor on 2nd line
Sending 16 data bytes
Sent 16 bytes
Received OK:WriteString [14] bytes
  • WriteString at Cursor
Sending 5 data bytes
Sent 5 bytes
Received OK:Clear [8] bytes
  • Clear Display
Sending 21 data bytes
Sent 21 bytes
Received OK:SetCursor-WriteString [24] bytes

SetCursor and WriteString at cursor (one command)

Sending 20 data bytes
Sent 20 bytes
Received OK:SetCursor-WriteString [24] bytes
  • SetCursor and WriteString at cursor, 2nd line

8. Finish

Sending 2 data bytes
Sent 2 bytes
Received Done [4] bytes

C:\SoftataConsole.exe (process 48412) exited with code 0.
  • Finished

 TopicSubtopic
   
 This Category Links 
Category:Softata Index:Softata
  Next: > Softata
<  Prev:   Softata