12-04-2012 07:13 PM
Hello everyone,
I have a kind of project like a proximity matrix. Pretty much is like 16 LED boards in 4 by 4 config.
I need to make a GUI that can show what I see physically. I.E.: I have one block of LED that shows me the intensity or brightness of the LED is full or half of the intensity and I want that same value or data show up on the screen with a delay of almost none.
I am using a PIC16f73 with IrDA sensors. The sensor send the value to the ADC of the PIC and then send that value to the PWM port which control the LED then that same Digital value it will go to the PC via Master/Slave SPI communication.
Let say, I have the value 11001100 coming from the Slave and goes through the Master then go to the PC via SERIAL port, I want the GUI read that and interpret that as specific value and change the intensity of that block on the GUI.
How can I do that? I already draw 16 Blocks(LEDs) using the LabView, but I dont know what to do in order to take the reading of the Serial Port then interpret that and make a look table and the screen will change the color from black to white depending the intensity.
Can anyone help me with this issue please.
Solved! Go to Solution.
12-04-2012 07:28 PM - edited 12-04-2012 07:28 PM
Do you want to only display if the LED is ON or OFF? What does the example (11001100) mean exactly, e.g., 1 bit per LED (on/off) or 4 bits per LED (16 levels of intensity)?
If you have levels of intensity that you want to show on a GUI, then an "intensity" chart sounds like the ideal indicator. You would just need to map the LED intensity values to the chart, e.g, 4x4x16 for x, y, and z.
More details, particularly about what you actually receive on the PC end would help.
12-04-2012 07:43 PM
Hi BillMe,
Thanks for your reply, On the computer side I will be receiving 8 bits data where is corresponding to one of the 16 block of LEDs. I need to make a table that from 00000000 to 11111111 or 0 to 255 in dec and from 0 to 255 it will be the range of intensity.
I need to make on the GUI side 16 blocks in 4 by 4 config.
How can I map the SERIAL Data coming from the PIC 16f73 to the labview. On the labview side I have already 4 by 4 leds blocks, I dont know if I have to use another indicator that can change the color from black to white according to the intensity.
I am new on this stuff, thanks for your patient. 🙂
12-04-2012 09:53 PM
@FACH1511 wrote:
Hi BillMe,
Thanks for your reply, On the computer side I will be receiving 8 bits data where is corresponding to one of the 16 block of LEDs. I need to make a table that from 00000000 to 11111111 or 0 to 255 in dec and from 0 to 255 it will be the range of intensity.
I need to make on the GUI side 16 blocks in 4 by 4 config.
How can I map the SERIAL Data coming from the PIC 16f73 to the labview. On the labview side I have already 4 by 4 leds blocks, I dont know if I have to use another indicator that can change the color from black to white according to the intensity.
I am new on this stuff, thanks for your patient. 🙂
Just to make sure I understand....you have sixteen 4x4 blocks of LEDs....that's 256 LEDs in total. The eight bits you receive points to ONE of those 256 LEDs (upper 4 bits = which block (1-16), lower 4 = which LED (1-16) in the block). Where is the intensity information?
12-04-2012 10:08 PM
Let put it in this way,
One block has 10s LED that is controlled by a PIC. The sensor is sending voltage through the ADC and send it to a PWM. The same value coming from the ADC to the PWM it will be sent to the PC in 8 bit format. That 8bit is from 00000000 to 11111111 which on decimal is 0 to 255.
That 8-bit data will declare or state what intensity is the LED. I have to make a table on the GUI side that change the binary to dec and set the range of intensity from 0 to 255. 0 will be the lower intensity which in this case will become as White Color and 255 will become as Black color or viceversa.
So, this is the configuration:
1x Master
8x Slave
Each slave controls 2x sensor through ADC and send to each PWM. Each PWM control one block. Each PIC has 2 PWM and 2 ADC (on my config).
Master: it will send a signal to the chip selector SS bar, and request that chip to send data to the master and the master send via UART to the PC using USB cable. That data on that moment will be received and it will go to one of the block.
According to this, what is your suggestion?
Thanks for your help BillMe
12-04-2012 10:58 PM
Assuming you have access to the master signal so you know which LED is being controlled, you would set the intensity of the LED on the appropriate "block" (intensity graph) with the ADC data you receive back. In other words, the master signal would map the block and LED to a front panel intensity graph and XY location, and the ADC data will determine the value (intensity) at that point on the graph.
12-04-2012 11:12 PM
No, the Master is only sending a signal to a specific chip according to the SS. I am using PORTB in order to select which Slave to read... the master is only controlling the communication side, sending signal to enable the communication side of the slave and receive the data. It will read from Slave 0 to Slave 7 and send it to the USB in 8 bit format then each packet of data will be corresponding to each block in the GUI...
The slave is the one who is controlling the LEDs.. one sensor per block. One slave is controlling 2 blocks. So, 2 sensors coming and 2 PWM going out.
I didnt figure out the way that the data will be send to the master and then to the USB. First, I have to figure out how to make a GUI.
On LabView can I do that? Make 16 boxes in 4x4 format and then set a time(uS) to read and transfer that to the block displaying the corresponding color?
12-04-2012 11:34 PM
@FACH1511 wrote:
I didnt figure out the way that the data will be send to the master and then to the USB. First, I have to figure out how to make a GUI.
On LabView can I do that? Make 16 boxes in 4x4 format and then set a time(uS) to read and transfer that to the block displaying the corresponding color?
Yes, one of the advantages of LabVIEW is the ease of creating a GUI. Take a look at the Intensity Graph.
12-04-2012 11:48 PM
How can I interface it with the USB port? Also, how can I just keep the internal color box and get rid of the X and Y axis?
12-05-2012 01:21 AM
What I understand from your Question is that you want to change colors of LED (16 nos.) from incoming 16 Data (8 bits). You can change color of LED by going through their property node map your Decimal equivalent to a color.