示例#1
0
        public static void Main()
        {
            I2CDevice.Configuration config = new I2CDevice.Configuration(0x12, 400);
            I2CDevice i2c = new I2CDevice(config);

            m_display = new TWIDisplay(i2c);

            m_display.clear();
            m_display.setBrightness(255);

            while (true)
            {
                m_display.clear();

                for (int i = 0; i < 10; i++)
                {
                    m_display.writeStr("DOT-");
                    Thread.Sleep(400);
                    m_display.writeStr("-NET");
                    Thread.Sleep(400);
                }

                testTime();

                m_display.writeTemperature(32, 'C');
                Thread.Sleep(1000);
                m_display.writeTemperature(-4, 'F');
                Thread.Sleep(1000);
                m_display.writeTemperature(-17);
                Thread.Sleep(1000);

                m_display.clear();

                for (int i = 0; i < 4; i++)
                {
                    m_display.setDot(i, true);
                    Thread.Sleep(500);
                }

                for (int i = 0; i < 4; i++)
                {
                    m_display.setDot(i, false);
                    Thread.Sleep(500);
                }

                m_display.clear();
                m_display.setRotateMode();

                for (char i = 'A'; i <= 'Z'; i++)
                {
                    m_display.writeChar(i);

                    Thread.Sleep(200);
                }

                m_display.clear();
                m_display.setScrollMode();

                for (char i = 'A'; i <= 'Z'; i++)
                {
                    m_display.writeChar(i);

                    Thread.Sleep(200);
                }

                m_display.clear();
                m_display.setRotateMode();

                for (int i = 0; i <= 9999; i += 3)
                {
                    m_display.writeInt(i);
                    Thread.Sleep(10);
                }
            }
        }