.


:




:

































 

 

 

 


3 Arduino




.. , ..

 

 

 

 

()

 


 

681.518.5

 

. . ..

 

 

.., ..

: / .. , .. - .. . : (), 2016. 27 .

 

.

, .

 

 

681.518.5

 

 

-

() .. , 2016

 


 

 

1. . 4

.. 4

. 4

2 (GUI) C#. 10

. 10

. 10

3 Arduino. 15

.. 15

. 15

4 . 19

.. 19

.. 19

. 19

 


1. .

: Visual Studio Integrated Development Environment (IDE - ) C# C# .

1. Microsoft Visual Studio 2012.

2. .

3. , .

4. .

. 1 Microsoft Visual Studio Microsoft, . , , Windows Forms, -, -, - , , Windows, Windows Mobile, Windows CE,.NET Framework, Xbox, Windows Phone.NET Compact Framework Silverlight.

Visual Studio IntelliSense . , . , -, . Visual Studio () , (, , Subversion Visual SourceSafe), (, - ) (, Team Explorer Team Foundation Server).

Visual Studio 2012 , 2010. Visual Studio 2012 Express , , (Visual Basic 2010 Express, Visual C# 2010 Express), Visual Studio Express: Visual Studio Express 2012 Web, Visual Studio Express 2012 Windows 8, Visual Studio Express 2012 Windows Desktop, Visual Studio Express 2012 Windows Phone Visual Studio Team Foundation Server Express 2012. . Visual Studio Express 2012 Windows 8 Windows Store Modern-, Visual Studio Express 2012 Windows Desktop . Visual Studio Team Foundation Server Express 2012, Visual Studio 2012.

. 2 Visual Studio (. 1.1).

. 1.1 Visual Studio (VS)

. (. 1.2) , , .

. 1.2

, .NET Framework, . , , , , .

:

. 1.1

FITU_31_LAB1
Windows Forms
.NET 2.0

ʻ . (. 1.3), .

. 1.3

(. 1.2):

. 1.2

Text C#
FormBorderStyle FixedToolWindow

(. 1.4). > F5

. 1.4

. Button (. 1.5).

. 1.5 Button

(. 1.3):

. 1.3 Button

Text
Dock Bottom

- . (. 1.6). . Click. IDE , , . :

MessageBox.Show(" - #", "!");

, (. 1.6).

. 1.6

. 3 2 (. 1.4)

 

 

. 1.4

Name B1 B2
Text 1 2
Dock Bottom
BackColor ControlLightLight ControlDarkDark

, ( BackColor) . :

var bc = B1.BackColor;

B1.BackColor =????

B2.BackColor =????

 


2 (GUI) C#

: Windows Forms C# MS Visual Studio.

.

1. .

2. , .

3. , C#.

4. .

.

. 2 Windows Forms Application. Solution Explorer Add>>Class. Talker.cs, Talker. Talker.cs.

using System.Windows.Forms, a :

. 1- Talker

BlahBlahBlah() . , . , . . thingToSay numberOfTimes. , TextBox NumericUpDown.

,

. 2

, , BlahBlahBlah(). len :

private void buttonl_Click(object sender, EventArgs e){

//

/

}

. 3 Windows Forms Application Solution Explorer Guy. using System.Windows.Forms, :

. 4 Guy

. bank . Name Properties. joesCashLabel bobsCashLabel label1 1b12, .

. 5

 

 

. j bob. bank , , . :

. 6 Form1

UpdateForm(), . void, . :

. 7 ,

, buttonl, - button2. , buttonl_Click() button2_Click() , :

. 8

$50, $100

Cash Name . InitializeComponent(), . , , $10 , $5 .

. 9

. Guy , Name Cash. C# . IntelliSense.

, Joe .

joe = new Guy();

joe.Name = "Joe";

joe.Cash = 50;


 

3 Arduino

: Arduino Uno R3, Arduino.

1. Wiring ().

2. Arduino Uno, / =0.5 .

3. , .

4. , .

5. , .

6.

.1. Arduino Arduino IDE (. 1)

. 1 Arduino IDE

, -.

:

// ,

#include <SPI.h>

#include <Ethernet.h>

// :

// = ;

byte mac[] = {

0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

IPAddress ip(192,168,1, 177);

IPAddress gateway(192,168,1, 1);

IPAddress subnet(255, 255, 0, 0);

EthernetServer server(23);

boolean alreadyConnected = false;

// setup.

// .

//

void setup() {

Ethernet.begin(mac, ip, gateway, subnet);

server.begin();

Serial.begin(9600);

while (!Serial) {}

Serial.print("Chat server address:");

Serial.println(Ethernet.localIP());

}

// loop

//

void loop() {

EthernetClient client = server.available();

if (client) {

if (!alreadyConnected) {

client.flush();

Serial.println("We have a new client");

client.println("Hello, client!");

alreadyConnected = true;

}

if (client.available() > 0) {

char thisChar = client.read();

server.write(thisChar);

Serial.write(thisChar);

}

}

}

.2-4. Blink

(. 2).

. 2 Blink

loop :

void loop() {

digitalWrite(led, HIGH); //

delay(1000); //

digitalWrite(led, LOW); //

delay(1000); //

}

, delay().

, - , loop(), . loop() .

2 : .

5. :

int led =???;

int brightness = 0; //

int fadeAmount = 5; // 1

void setup() {

pinMode(led, OUTPUT);

}

void loop() {

// arduino:

analogWrite(led, brightness);

//

brightness = brightness + fadeAmount;

// (/)

if (brightness == 0 || brightness == 255) {

???;

}

// /

???

}


 


 





:


: 2017-02-24; !; : 1209 |


:

:

! . .
==> ...

1832 - | 1635 -


© 2015-2024 lektsii.org - -

: 0.079 .