Hi,
I did all the preparations which are explained here: http://redpitaya.readthedocs.io/en/late ... stApp.html
So 'myFirstApp' was created.
Then I tried to follow these instructions: http://redpitaya.readthedocs.io/en/late ... EDbut.html
FIRST QUESTION (WEB UI section):
I pasted the code for the button in index.html, but where do I have to paste the following code?
< div id='led_off'>LED Off</div>
< div id='led_on'>LED On</div>
The button is displayed, but the above code appears right behind the button. Do I have to put that code somewhere else?
The instructions are not clear about this point for me.
2ND QUESTION (WEB UI section / file app.js):
I pasted the code for APP.LED_State = false just above the $function{} line in app.js
I have no idea if this is OK. The instructions are not mentionning where exactly these lines need to be pasted.
3TH QUESTION (Section 'Controller')
I opened src/main.cpp
Where do I have to paste the code "CBooleanParameter ledState("LED_STATE", CBaseParameter::RW, false, 0);"
I pasted the ledstate.update() code at the end of main.cpp, just above the list of void procedures.
Is that OK?
4TH QUESTION
The instructions tell me not to forget to initApp() and release it elsewhere (rp_app_init() etc...)
Where? How?
Then I compiled the application (not the congtroller??) in ...MyFirstApp directory using the make INSTALL_DIR command.
message from syste:: nothing to be done for 'all'
Button is visible, but no led is switched on/off
Any help is welcome.
Best regards,
Herman.
MyFirstApp example : does not work
-
- Posts: 9
- Joined: Sat Feb 18, 2017 6:00 pm
-
- Posts: 89
- Joined: Tue Mar 29, 2016 7:41 pm
Re: MyFirstApp example : does not work
Hi there was a resent update to the docs
There was a note added
best of luck
There was a note added
Try loading the fpga_0.94.bit FPGA image as stated in the note and try again.Note:
Requierment for manipulating leds using api is to first load fpga_0.94.bit fpga bitstream image. That can be done using next command line instruction: “cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg”
best of luck
-
- Posts: 12
- Joined: Tue Sep 26, 2017 10:55 am
Re: MyFirstApp example : does not work
I just tried to do the "myFirstApp" example on my own, and I experienced the same issues.
First of all, basic knowledge in HTML, JavaScript and C(++) programming seems to be required implicitly.
I solved the issues by looking into "/root/RedPitaya/Examples/web-tutorial/2.led/" directory. There, all files are already modified in the required way.
I recommend to paste it within the div tag called "content".
I'd also like to know what's the difference between "UpdateParams" and "OnNewParams" functions.
"rpApp_Release()" must be pasted within {} brackets of "rp_app_exit()" function.
If you want to understand these parts, you will have to study the API files and you need basic knowledge how to adress/write/read registers (microcontroller programming).
Nevertheless, two more things:
First of all, basic knowledge in HTML, JavaScript and C(++) programming seems to be required implicitly.
I solved the issues by looking into "/root/RedPitaya/Examples/web-tutorial/2.led/" directory. There, all files are already modified in the required way.
The code has to be pasted within the body tags.hvanmunster@gmail.com wrote:FIRST QUESTION (WEB UI section):
I pasted the code for the button in index.html, but where do I have to paste the following code?
< div id='led_off'>LED Off</div>
< div id='led_on'>LED On</div>
I recommend to paste it within the div tag called "content".
You can insert a <br> tag between </div><div> to create a new line.hvanmunster@gmail.com wrote:The button is displayed, but the above code appears right behind the button. Do I have to put that code somewhere else?
The instructions are not clear about this point for me.
The code has to be pasted between "$(function() {" and "APP.startApp();". I can neither explain why.hvanmunster@gmail.com wrote:2ND QUESTION (WEB UI section / file app.js):
I pasted the code for APP.LED_State = false just above the $function{} line in app.js
I have no idea if this is OK. The instructions are not mentionning where exactly these lines need to be pasted.
In C(++), global variables have to be declared between the #inlcude-part and the first function. Therefore, put it after "#include "main.h"".hvanmunster@gmail.com wrote:3TH QUESTION (Section 'Controller')
I opened src/main.cpp
Where do I have to paste the code "CBooleanParameter ledState("LED_STATE", CBaseParameter::RW, false, 0);"
It has to be pasted within the {} brackets of the "OnNewParams" function.hvanmunster@gmail.com wrote:I pasted the ledstate.update() code at the end of main.cpp, just above the list of void procedures.
Is that OK?
I'd also like to know what's the difference between "UpdateParams" and "OnNewParams" functions.
"rpApp_Init()" must be pasted within {} brackets of "rp_app_init()" function.hvanmunster@gmail.com wrote:4TH QUESTION
The instructions tell me not to forget to initApp() and release it elsewhere (rp_app_init() etc...)
Where? How?
"rpApp_Release()" must be pasted within {} brackets of "rp_app_exit()" function.
If you want to understand these parts, you will have to study the API files and you need basic knowledge how to adress/write/read registers (microcontroller programming).
Interesting. I would have expected compiler errors because of how you modified "main.cpp" file.hvanmunster@gmail.com wrote:Then I compiled the application (not the congtroller??) in ...MyFirstApp directory using the make INSTALL_DIR command.
message from syste:: nothing to be done for 'all'
Nevertheless, two more things:
- Even if you did all things right till here, you would experience a compiler error. To complete compiling successfully, you still have to modify "main.h" file.
- If you compile directly "/root/RedPitaya/Examples/web-tutorial/2.led/", the compiler will still report a couple of warnings. Confusing in some way.
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: Google [Bot] and 45 guests