Notifications
Clear all

Mega and 2 FC-16 Modules

60 Posts
4 Users
6 Likes
3,994 Views
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Still trying to get my feet on the ground using Arduino. I have a Mega and 2 FC-16 LED modules.

At this point I have 1 FC-16 module connected to the Mega using the SPI bus. Works fine. Can send message to it and it works! Big accomplishment for me!

What I would like to do now is connect a second FC-16 module to the SPI bus and send a different message to it.

How would I go about coding it up?  End result is to have different data going to each FC-16 module.

Thanks for any guidance.

Alan


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

Without looking at the code, just copy/paste then change any pin assignments for the second FC-16 and name it differently, then send different msg to that. Conceptually that is what is required. If you want line by line code then someone else with the code can help.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Thanks Ron. Sounds simple but not for me just learning all this. Both FC-16 modules will be on one SPI bus so I guess I need to research how to steer the data to the proper FC-16 module. Have not figured that out yet! 🙂

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Is the code from the arduino examples menu?

If it was me, I would look at the code looking for words with SPI in them. Somewhere the code has to 'connect' a pin on the arduino SPI bus to your code. Put the similar wire from the other FC-16 on another similar pin (they are marked on the board, either Dx for digital or Ax for analog). If I could see the code I could help better, but don't post a lot of it here except via the 'source code' widget above {;}

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Ron - yes I am using an example code. Not sure but I think the pin you are referring to is the CS pin. ( Chip Select ?? ) I will look.

Not familiar with the source code widget. New to this site.

Thanks!

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Where did you get the sample code, is it one of the builtin arduino examples? NOT A pin, probably a bunch, that's why you have a mega, lots of pins. The source code widget is just above the o in above and looks like {;}. A box will pop up, paste the code.

Screen Shot 2022 02 27 at 15.23.41

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Code is not one of the built in Arduino scripts. Found it on one of the learning sites.

Sorry - do not see the 0 above.    Above where or what?

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l When making a reply there is a toolbar directly above where I am typing^^ there is the source code tool. You only see it when replying.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Your code will probably have something like what is in the attached image. I suspect the only one that has to be different is the DIN pin. I don't have the full source code so do not know how DIN is used, but it will undoubtedly be an arg to a subroutine call. 

Screen Shot 2022 02 27 at 15.39.28

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Do not see what is in your image however I bet it is included in one of the required libraries. spi.h ?


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Not likely for a couple reasons. Again, paste the code into the source widget. Just reply to this message, and click the {;} that is 3rd from right after X and happy face.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

// Including the required Arduino libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Uncomment according to your hardware type
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
//#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW

// Defining size, and output pins
#define MAX_DEVICES 4
#define CS_PIN 3

// Create a new instance of the MD_Parola class with hardware SPI connection
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l No. I have never had to use it so let me try to see what it does.

 

// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

Well that doesn't impress me, I was hoping it kept the formatting. I don't know why yours didn't show up

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Ok, that is NOT an OLED, that is a LED matrix. You string together as many as you want (not sure what linit is) and it is usually scrolling left to right. Your data will be text. That means if you are reading it from some place, then you put some text in a buffer and make the appropriate library call to send it out. If you want two of these displays, then I am out of my wheelhouse. I see 3 pins in addition to G and 5V. CLK is probably the same, CS will be different I suspect to select which display will receive the next chunk of data but maybe not as the last pin is the DIN (Data In) so perhaps that is the only pin you change. The code is very conceptually

Fill buffer 1 with msg 1

write to D1

fill buffer 2 with msg 2

write to D2

in a loop with a read of some sort to get fresh data.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 4