الثلاثاء، 24 أبريل 2018

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication72
{
    class Program
    {
        static void Main(string[] args)
        {
            int Age;
            double Weight;
            string yourName;
            Console.WriteLine("What is ypur name?");
            yourName = Console.ReadLine();

            Console.WriteLine("What is ypur age?");

            Age = int.Parse(Console.ReadLine());

            Console.WriteLine("What is your Weight");
            Weight = double.Parse(Console.ReadLine());

            Console.WriteLine("your Name is {0} and your age is {1} and your weight is {2}", yourName, Age, Weight);
            Console.ReadKey();

        }
    }
}

الاثنين، 23 أبريل 2018

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = 42;
            double pi = 3.14;
            char y = 'z';
            bool isonline = true;
            string firstName ="david";
            Console.WriteLine (x);
            Console.WriteLine (pi);
            Console.WriteLine (y);
            Console.WriteLine(isonline);
            Console.WriteLine(firstName);
            Console.ReadKey();


        }
    }
}

الثلاثاء، 17 أبريل 2018

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication21
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("************************");
            Console.ReadKey();
            Console.WriteLine("*     name: khaldon asfor        *");
            Console.ReadKey();
            Console.WriteLine("*   class: 10th grade  *");
            Console.ReadKey();
            Console.WriteLine("*     school:tss       *");
            Console.ReadKey();
            Console.WriteLine("************************");
            Console.ReadKey();
        }
    }
}

الخميس، 22 مارس 2018


int input=A0; //The word “input” now stands for the value “A0”
int LED=13; //”LED” now stand for the value 13
int sensorvalue=0; //Variable for the sensorvalue with 0 as starting value
void setup()
{ //The setup begins here
pinMode (LED,OUTPUT); //The pin 13 connected to the LED is defined as an output
}
void loop()
{ //The loop part begins here
sensorvalue= analogRead(input); //The voltage at the potentiometer is read
//out and gets saved as a number between 0 and 1023 under “sensorvalue”
digitalWrite (LED,HIGH); //Turn on LED
delay(sensorvalue); //The value, which is saved under “sensorvalue” defines
//how long the LED will light up (milliseconds)
digitalWrite(LED, LOW); //Turn off LED
delay(sensorvalue); 

الخميس، 15 مارس 2018






 Arduino Starter Kit example
 Project 13  - Touch Sensor Lamp

 This sketch is written to accompany Project 13 in the
 Arduino Starter Kit

 Parts required:
 1 Megohm resistor
 metal foil or copper mesh
 220 ohm resistor
 LED

 Software required :
 CapacitiveSensor library by Paul Badger
 http://www.arduino.cc/playground/Main/CapacitiveSensor

 Created 18 September 2012
 by Scott Fitzgerald

 http://www.arduino.cc/starterKit

 This example code is part of the public domain
 */

// import the library (must be located in the
// Arduino/libraries directory)
#include <CapacitiveSensor.h>

// create an instance of the library
// pin 4 sends electrical energy
// pin 2 senses senses a change
CapacitiveSensor capSensor = CapacitiveSensor(4, 2);

// threshold for turning the lamp on
int threshold = 1000;

// pin the LED is connected to
const int ledPin = 12;


void setup() {
  // open a serial connection
  Serial.begin(9600);
  // set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // store the value reported by the sensor in a variable
  long sensorValue = capSensor.capacitiveSensor(30);

  // print out the sensor value
  Serial.println(sensorValue);

  // if the value is greater than the threshold
  if (sensorValue > threshold) {
    // turn the LED on
    digitalWrite(ledPin, HIGH);
  }
  // if it's lower than the threshold
  else {
    // turn the LED off
    digitalWrite(ledPin, LOW);
  }

  delay(10);
}