Using Attributes in Component :

This component shows how to declare attributes
Action button is used to set the user input onto the attribute

To use a attribute in the component, use

{!v.attributeName}

To Access the attribute in js of the component , use

component.set("attributeName")

The following program is a demo of attribute usage and action usage in lightning
Component Code :

Create a lightning component with the below markup code
Name the component as UsingParameterInLightning_Cmp or any name you like

<!--


 * created by 		:		Shiva RV
 * Date				:		14-10-2018
 * Description		:		Attribute and Action Usage in lightning
  
-->

<aura:component >
    
    <!-- start of Attribute declaration -->
     <aura:attribute type="String" name="message" default="hello default value"></aura:attribute>
    <aura:attribute type="Integer" name="countValue" default="1"></aura:attribute>
    <!-- Register Event -->
	
    <!-- End Of Register Event -->
    
    Hello Message String Attribute Data --- {!v.message} 
    <br/>
    Hello Counter Integer Attribute Data --- 
    {!v.countValue}
    
    <lightning:input name="userInput" value="" label="Your Input Text" aura:id="userInput"/>
    <lightning:button name="Set This Value" label="Set This Value" onclick="{!c.handleActionToSet}"></lightning:button>
</aura:component>
Component Js Code :

Go to the component controller and copy paste the below code 
 

({
	handleActionToSet : function(component, event, helper) {
		//This method is used to set the attribute of component
		console.log(component.get("v.message"));
        var inputText=component.find("userInput").get("v.value");
        if(!inputText)
        {
            inputText="no value is entered in the text box";
        }
        component.set("v.message",inputText);
       	console.log(component.get("v.countValue"));
 		component.set("v.countValue",component.get("v.countValue")+1);
        
	}
})
Below is the hello world App code:
<!--


 * created by 		:		Shiva RV
 * Date				:		13-10-2018
 * Description		:		Hello World Lighting App
  
-->

<aura:application extends="force:slds">
	<!--this is the lightning app where you can place html codes , associate js code
		also can embed lightning component to it -->
   
    <!-- Aura:Attribute Usage -->
    <c:UsingParameterInLightning></c:UsingParameterInLightning>
    
</aura:application>

<c:ComponentName> </c:ComponentName> (Use UsingParameterInLightning_Cmp  or the Component name you just created)

Output: