@@ -22,6 +22,8 @@ void setup()
2222 test1 ();
2323 test2 ();
2424 test3 ();
25+ test4 ();
26+ test5 ();
2527
2628 Serial.println (" \n done ...\n " );
2729}
@@ -35,7 +37,7 @@ void test1()
3537 FSO.write (0x55 );
3638 }
3739 duration1 = micros () - start;
38- Serial.print (" FastShiftOut1 : " );
40+ Serial.print (" write : " );
3941 Serial.println (duration1 * 0.001 );
4042
4143 start = micros ();
@@ -45,7 +47,7 @@ void test1()
4547 FSO.write (0x55 );
4648 }
4749 duration2 = micros () - start;
48- Serial.print (" FastShiftOut2 : " );
50+ Serial.print (" write : " );
4951 Serial.println (duration2 * 0.001 );
5052 Serial.print (" Delta: " );
5153 Serial.println ((duration2 - duration1) * 0.001 );
@@ -55,6 +57,60 @@ void test1()
5557
5658
5759void test2 ()
60+ {
61+ start = micros ();
62+ for (int i = 0 ; i < 1000 ; i++)
63+ {
64+ FSO.writeLSBFIRST (0x55 );
65+ }
66+ duration1 = micros () - start;
67+ Serial.print (" writeLSBFIRST: " );
68+ Serial.println (duration1 * 0.001 );
69+
70+ start = micros ();
71+ for (int i = 0 ; i < 1000 ; i++)
72+ {
73+ FSO.write (0x55 );
74+ FSO.write (0x55 );
75+ }
76+ duration2 = micros () - start;
77+ Serial.print (" writeLSBFIRST: " );
78+ Serial.println (duration2 * 0.001 );
79+ Serial.print (" Delta: " );
80+ Serial.println ((duration2 - duration1) * 0.001 );
81+ Serial.println ();
82+ delay (100 );
83+ }
84+
85+
86+ void test3 ()
87+ {
88+ start = micros ();
89+ for (int i = 0 ; i < 1000 ; i++)
90+ {
91+ FSO.write (0x55 );
92+ }
93+ duration1 = micros () - start;
94+ Serial.print (" writeMSBFIRST: " );
95+ Serial.println (duration1 * 0.001 );
96+
97+ start = micros ();
98+ for (int i = 0 ; i < 1000 ; i++)
99+ {
100+ FSO.writeMSBFIRST (0x55 );
101+ FSO.writeMSBFIRST (0x55 );
102+ }
103+ duration2 = micros () - start;
104+ Serial.print (" writeMSBFIRST: " );
105+ Serial.println (duration2 * 0.001 );
106+ Serial.print (" Delta: " );
107+ Serial.println ((duration2 - duration1) * 0.001 );
108+ Serial.println ();
109+ delay (100 );
110+ }
111+
112+
113+ void test4 ()
58114{
59115 start = micros ();
60116 for (int i = 0 ; i < 1000 ; i++)
@@ -81,7 +137,7 @@ void test2()
81137}
82138
83139
84- void test3 ()
140+ void test5 ()
85141{
86142 Serial.println (" \n Test print interface" );
87143 start = micros ();
@@ -120,4 +176,4 @@ void loop()
120176}
121177
122178
123- // -- END OF FILE --
179+ // -- END OF FILE --
0 commit comments