Vba For Excel Serial Communication With Arduino Microcontroller
Dec 23, 2015 In this video you will find all the necessary tools to establish a serial communication between Arduino board and Microsoft Excel file directly using your USB cable. Arduino serial connection to Excel VBA, no third party software needed. I suspect that code would not work with an Uno or Mega which are.
Code: Private Sub CommandButton1_Click() ' Buffer to hold input string Dim Instring As String ' Use COM13 MSComm1.CommPort = 13 ' 9600 baud, no parity, 8 data, and 1 stop bit. MSComm1.Settings = '9600,N,8,1' ' Tell the control to read entire buffer when Input ' is used. MSComm1.InputLen = 0 ' Open the port. MSComm1.PortOpen = True ' Send the data to the port data = TextBox1.Text ' The brightness required, 0-255 Debug.Print 'Data=' & data ' Send the data to the Arduino. MSComm1.Output = data & vbCrLf ' Close the Port MSComm1.PortOpen = False End Sub Any thoughts? Moderator edit: [code] [/code] tags added.
Dear AVR Pros, i am looking for an easy and affordable way to interface an SPI Daisy chain consisting of 30 or more ATmega8 Slaves with a Windows 7 PC with Excel VBA. Cccam ipk open atv images to draw. I was thinking about an Arduino or something like that to receive serial commands from Excel and translating them to be fed on the SPI bus. Is this actually possible or is there maybe an easier way, such as a USB to SPI adapter which can be talked to via a virtual com port? I guess the AVRISP mkII can't be used for this since i couldn't figure out how to generate custom bytes at its SPI output. I appreciate any kind of input, since i am quite a newbie in microcontrollers. Thank you very much in advance! Best regards.
Thank you guys! @ clawson: after further investigation, the Arduino sounds like a good solution to me. I hope i didn't overlook any disadvantages which could affect my project. I will only be using one SS-line and daisy chain the slaves together according to this connection scheme: So basically i will be pushing the data through all the slaves and they will filter out whats meant for them using unique addresses. @ awneil: can you tell me what is better about the expensive device, compared to an Arduino or the cheap USB devices you mentioned? I really appreciate your help guys, thank you! I've seen this thread before, but can't see how it relates to the problem.
Of course i will try to make the lines as short as possible, maybe even just stack the master and slave pcbs on top of each other. In post #3 of the mentioned thread there is an example calculation, mentioning a 28 feet distance at 8 mHz SPI clockrate. I don't even think that i will need 8 mHz since i only need to transmit 24 bit to each slave with an update rate of maybe 20 ms. Is there something i'm overlooking? Thank you very much! Best regards. Prizefighter wrote: @ awneil: can you tell me what is better about the expensive device, compared to an Arduino or the cheap USB devices you mentioned?
Well, what constitutes 'better' depends entirely on the particular requirements! You can see an overview of key features & performance here: Trying to think back (it was a couple of years ago), IIRC, the key requirement was for an SPI Slave; which is what ruled-out the FTDI devices - but doesn't matter for you. Also, being a supported off-the-shelf unit, in a proper case, was a big plus.