-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use of enum ‘receiver_state’ without previous declaration error in the LiFiReceiver.ino #1
Comments
can you try again ? I just did a push. |
I have just tried it now on a project I am working on and appear to have the same issue. Here is a copy of my error messages in case they are useful to you: Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno" lifi_transiver:78: error: use of enum 'receiver_state' without previous declaration Used: C:\Users\NetLab\Documents\Arduino\libraries\TimerOne Not used: C:\Users\NetLab\Documents\Arduino\libraries\TimerOne-r11 use of enum 'receiver_state' without previous declaration This report would have more information with |
Thank you for your reply @jpiat now i successfully dumped my code. The error was enum has to be given in the separate header file. Arduino IDE will not accept this typedef in the program. @lawrenciumbc try this, so i created separate include "types.h" in the program with the enum lines now its working. @jpiat now code is dumped but i am not able to see anything on the serial monitor? how exactly we have to do to get output on the serial monitor after dumping the code. |
Do you have the emitter lighting the led (what color) ? Do you have the 2015-11-27 6:44 GMT+01:00 Sainandan notifications@github.com:
|
Demo code is setup for Analog input 3 to be used. 2015-11-27 7:08 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
On the transmitter side i have connected RED LED to the Digital 13 pin and dumped the emitter code LED blinks only once after code dumping, on the receiver side i have connected RED LED in parallel with 1 M ohm resistor to the A3 and other terminal of the LED to the GND and dumped receiver code. Now i open the serial monitor on the receiver side and wait for the response, but i dont get any and i tried typing on transmitter serial monitor but there is no response on the receiver serial monitor. The baud rate i have set 1200. Can you please tell me how to proceed after connections and dumping the code. |
For the emitter to use D13, you need to uncomment : //These defines are for a LED connected on D13 and comment the definition of the same macros some lines after. Baudrate is setup for 115200bps. 2015-11-27 7:41 GMT+01:00 Sainandan notifications@github.com:
|
Now i did that modification and i see my transmitter LED is glowing now continuosly its an improvement thank you, but at the receiver code should i make any changes, because even now i don't see anything on the serial monitor and i also tried typing something on the serial monitor of transmitter and i don't see anything on the receiver screen. My receiver has this configuration LED +ve is connected to A3 and a resistor in parallel to the LED +ve and the other terminal of the resistor, LED -ve are connected to the GND. IS this config correct or should we do something else. Resistor is 1 Mohm. |
Wiring should now be good. You mentioned using a RGB led, what channel of 2015-11-27 9:24 GMT+01:00 Sainandan notifications@github.com:
|
I am using RED LED for both emitter and receiver, It is a normal low power LED.We are placing the emitter(LED) above the receiver(LED) to get the light focused.When we changed the symbol duration on the transmitter end we could observe the change at the emitter(LED) .Whereas there is no test to confirm about the working of receiver. After making the connections at the receiver side and dumping the code how can we say that the receiver is working? will i get some message on the serial monitor of the receiver? At now the emitter is fine but the receiver is not able to receive the message. |
You shoudl alter the emitter rate as emitter and receiver are synchronized 2015-11-27 10:11 GMT+01:00 Sainandan notifications@github.com:
|
I you have a oscilloscope available you can also try to measure the signal 2015-11-27 10:20 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
I have added a DEBUG symbol to the programm that allow to turn on/off the 2015-11-27 10:21 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
I have tried with oscilloscope i see that some square waves on the screen from the emitter, so something is coming from the emitter and receiver is not able to receive and process the signal. and i will check ur debug code and come back. |
@jpiat I see that i am getting some voltage on the multi meter and also on the oscilloscope but there is no response on the serial monitor of the receiver section, i did n't receive any message, the receiver circuit is also correct because i am getting some voltage, so i think the problem is with the code, i don't see anything on the screen and more over the debug code that you gave me is getting dumped into the arduino board but it is not loading inside the board(the LED with Letter L on the board is not glowing when i dump debug code.). Kindly troubleshoot me this issue. |
I don't understand what happen when loading the debug version in the 2015-11-30 5:07 GMT+01:00 Sainandan notifications@github.com:
|
@jpiat when i am loading even your present version of the code to the board that LED with Letter L on the board is not glowing even now it means program is dumped but board is not able to load, my board is Arduino UNO original model. It is NOT Cloned Model. and in the latest code what is PinMode(13, output) should i connect something to it? |
The L LED is not supposed to be lit up after connecting. This led does not 2015-11-30 15:37 GMT+01:00 Sainandan notifications@github.com:
|
If youd 'ont have any serial output, please make sure that you are 2015-11-30 15:59 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
what do you mean by serial connection enabled? After some time i will send you the video of my setup. |
i just made a push with a small change to display a start message in the 2015-12-01 15:43 GMT+01:00 Sainandan notifications@github.com:
|
@jpiat I am able to see your push message on the screen of the receiver serial monitor, and receiver circuit is LED and resistor(LED+ve and resistance one terminal are connected in the same vertical holes of the bread board and LED -ve and other terminal resistance are in the same vertical hole of the bread board) are connected parallel and green wire from the LED is given to the A3 and Yellow is given to the ground. Now i am able to see the message on the screen so what may be the problem that is stopping to receive the data. |
@jpiat After running a set of times i see that some times only some part of the println is getting printed (eg : Start of rece, instead of Start of receiver program) i don't know what is happening to the remaining letters and also i gave some println statement inside the void loop() like Serial.println("Inside the loop") and forever it is running inside the loop, so what may be causing the problem? please help with this and also can you explain me everything how you have connected recent one 1w LED(both transmitter and receiver), i will try to replicate your circuit and see if its working or not. |
The loop code, with DEBUG enabled, should print values as soon as data is 2015-12-02 16:06 GMT+01:00 Sainandan notifications@github.com:
|
When I try to debug the code with Println statements i see that in the inside the void loop(), the if (new_word == 1) is not getting executed so i wrote else statement for it and the program directly goes to the else statement because new_word is not becoming 1. I have tried some sample analog read program with my receiver circuit connection and when i shine the emitter i see the receiver is able to receive the values and i am able to see the change in the values depending on the shining. So with the same circuit connection when i dump your receiver code its not showing the output? The problem is i dump the code and shine emitter onto the receiver i don't see anything on the screen(only start of the... or with debug code i see only blank serial monitor), i am using latest arduino IDE 1.7.8 version i have. So you can mod your code and i will try to dump and see how it will run on my version. |
I'am using 1.6.6 that is latest stable. I have added a DEBUG_ANALOG option 2015-12-03 6:08 GMT+01:00 Sainandan notifications@github.com:
|
I have dumped your latest code with ANALOG DEBUG, I don't see any graph on my screen, but the serial monitor prints 1023 value continusly,,, do you know what that is? |
1023 means that the ADC is saturated ... I will post a commit in a sec to 2015-12-03 7:31 GMT+01:00 Sainandan notifications@github.com:
|
I just pushed a commit. If you comment the line : #define INT_REF the ADC will switch to the 5v reference instead of the 1.1v internal. 2015-12-03 9:52 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
Great ! This is the expected output. You cannot expect the transmission to 2015-12-03 11:29 GMT+01:00 Sainandan notifications@github.com:
|
@bsainandan Thanks for the types.h include suggestion, my verification is now not returning the enum error. This is all I am getting now (below). Any ideas on what this could be? Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno" lifi_code_rx:65: error: conflicting declaration 'char frame_buffer [38]' It appears that all of these such as 'frame_buffer[38]' is declared in both the emitter (lifi_code) and receiver code (lifi_code_rx). Do I need to edit one file to match the other? |
I really don't understand why this problem arise on your side and not on 2015-12-03 12:21 GMT+01:00 lawrenciumbc notifications@github.com:
|
I think i understand the problem and it could be all because of the 2015-12-03 14:51 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:
|
@jpiat Yeah i will try with Photosensor, and how did you drive 1w LED with the arduino board? will arduino drive 1w LED, i think it will burn? so how did you drive 1w LED and connect it to arduino .. will the same code work for that. |
@lawrenciumbc Try what jpiat has suggested https://www.arduino.cc/en/Main/Software download windows version and try to compile code and see? for me i just pasted the code on the arduino tab and then press ctrl + shift + N and save it as Type.h and pasted the enum part in it and on the program i gave #include "Type.h" thats all and it worked for me. |
@jpiat Hello i have updated LED receiver with the proper photo detector and everything is working fine but how to increase message length i see at maximum only 32 bytes of the data able to transfer, so how to increase the length so that i can send at least a big sentence. |
Cool ! Did you have to make any change to the code ? What is the max 2015-12-07 16:37 GMT+01:00 Sainandan notifications@github.com:
|
@jpiat no i didn't make any change to the code it was working cool, with the photodetector and distance i am able to reach more than 60cm , i f i use good detector then it may increase, my only concern now is how tp increase the text length, if you can show me how to change the program to add multiples of 32 bytes chunk i will try that basically i am not from coding back ground. |
hi all |
i just download arduino IDE v1.6.7 and the code working fine thanks all i will now try again |
thanks a lot . it is working now and i have hello world on the serial monitor . now i am trying to have best results by using 12 v led bulb . and mosfet . now i have good emitter ( transmitter with continuously streaming white light ) i am wondering about the suitable baud rate & distance of that transmission . also i would to ask about the receiver side. what is the kind of sensor needed to receive white light ? is it need special circuit to amplify the received signal . thanks in advance |
You could use a photo-diode or photo transistor but its not tested. The 2016-01-07 22:45 GMT+01:00 amirezz notifications@github.com:
|
thanks for your interest and reply . but 1 watt RGP led have 3 m range only and also is sensitive to the orientation issue ( don't know that from the code or the led itself) i need to use normal led bulb and already make transmitter circuit which continuously transmit data but can't receive data any idea about modify the code ( baud rate or arduino pin no ) . thanks in advance |
any updates . |
the comminication speed can be configured using the symbol period define in 2016-02-05 8:42 GMT+01:00 amirezz notifications@github.com:
|
I tried your code on my Arduino UNO board, when i dumped LiFiEmitter it is working fine on my Arduino board and when i dumped LIFIReceiver.ino to my Arduino UNO i am getting this following error
use of enum ‘receiver_state’ without previous declaration. Can you resolve me with this issue . Thanks in advance.
The text was updated successfully, but these errors were encountered: