• 0

ZYBO Led Blinker


Question

Hi guys, I am planning to build a ZYBO Led Blinker controlled by ethernet communication. Essentially, what this means is that I will be controlling the blinking speed of the led on the zybo through ethernet communication. Regarding this, I would like to get some advice on how I should build the c code. I already am able to send data through TCP/IP and get it to light up the way I want it to be, meaning if I were to put 1100, the led would light up in the sequence. Sorry if this is unclear as I am new to this.

Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0
40 minutes ago, DeAndreHJ said:

ive attached the files. The echo.c file is the program file and the main.c file is the lwIP template file.

echo.c

main.c

Ive tried to change the last part of the echo.c part with "

void set_led(char cmd[4])
{
    uint8_t led_value = 0;

    int i;

    for (i = 0; i < cmd[4]; i++) {
        led_value = i;

    xil_printf("LED value = %X\n", led_value);
    }

    // Write LED value to AXI GPIO
    XGpio_DiscreteWrite(&led, 1, led_value);
}

"

However, it fails. Any help with this c program would be greatly appreciated.

Link to post
Share on other sites
  • 0
2 hours ago, DeAndreHJ said:

Ive tried to change the last part of the echo.c part with "

void set_led(char cmd[4])
{
    uint8_t led_value = 0;

    int i;

    for (i = 0; i < cmd[4]; i++) {
        led_value = i;

    xil_printf("LED value = %X\n", led_value);
    }

    // Write LED value to AXI GPIO
    XGpio_DiscreteWrite(&led, 1, led_value);
}

"

However, it fails. Any help with this c program would be greatly appreciated.

Basically, I want to be able to have an input that can change the frequency of the blinking of the led (making it blink faster or slower). Like the tutorial https://reference.digilentinc.com/learn/programmable-logic/tutorials/zybo-creating-custom-ip-cores/start

Link to post
Share on other sites
  • 0

Hi jpeyron,

I have followed the tutorial "Creating a Custom IP core using the IP Integrator" https://reference.digilentinc.com/learn/programmable-logic/tutorials/zybo-creating-custom-ip-cores/start and have managed to merge it with the video shown below. Now, with my sdk echo code, I would very much like to know how I could go about initialising My_PWM_Core.

 

echo.c

Link to post
Share on other sites
  • 0

Hi @DeAndreHJ,

Are you adding a custom ip and getting errors? Or are you trying to modify the echo to allow you to alter the rate the leds are blinking? If you are trying to alter the echo then the echo.c i linked above does not echo text  but rather checks for specific strings and then prints out specific text. You could alter this code to change the variable you are using to change the PWM on the LEDs. Are you able to change the PWM on the LEDs in a project without the ethernet?

thank you,

Jon

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now