This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Simple Flashing LED code

Hi there

I am trying to write a simple code that will flash turn on an LED fro one I/O pine of the nrf24le1 in response to an input from another I/O pin of the nrf24le1. Basically, my code is an if loop that will set pin02 to 1 if the value at pin01 is above 1000. If the value falls less than 1000, I want P02 to turn off the LED.

The code this far is written like this:

//Set P0 as output

P0DIR=0x00;

if (P00>=1000)
{
//turn P00 on
P02 = 1;
}else{
P02 = 0;
}

This code is not working. Does anyone have any thoughts on how I should change it? this is my first time ever programming a microcontroller so any help is appreciated :) If you have any thoughts on how I should better figure out/ learn how to program, please let me know (ie. reading documentation, etc).

Thank you!

Emma

Parents Reply Children
No Data
Related