Null Refrence Expection

I am pretty new to unity

I am trying to change the value of text object in the canvas on update to do this I attached a script called textEdit to my text object but it attached itself to the main camera also and throws and nullRefrenceExpection error pointing at the camera what am I doing wrong here.

my textEdit Script looks like this

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class textEdit : MonoBehaviour {

public static int score;

Text text;
void awake()
{
        text = GetComponent<Text>();

    score = 0;
}
// Use this for initialization
void Start () {
   
}

// Update is called once per frame
void Update () {
    text = GetComponent<Text>();
    text.text = "test";

}

}

There is probably no Text component in the camera.

void Update () {
     if (text != null) {
          text.text = "test";
     }
}

Thanks @Owen-Reynolds for you input . I am actually trying to learn how to capture serial bluetooth input so I want to print the value coming from the com ports to the screen while the game runs so I can then trigger and event based on the data I am getting. The bluetooth device I am trying to connect to you sends the speed of a car or cycle based on wheel rotation per second.

for now I was just trying to find a way to print to screen on update.