Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 4:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Arduino Uno R3
PostPosted: March 22nd, 2017, 12:19 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Our latest DLL Toolkit 2017 now comes with beta support for the Arduino Uno R3 Electronics Prototyping Platform.

Having looked at both the PI and Bit, I settled on this platform as provides an affordable & accessible route into Opus Hardware projects.

There are three examples in development:

1. The LED Toggle (available now in the DLL)
2. Read the Temperature from a LM35.
3. Checking where a Push to Make switch has been pressed.

The actual DLL function will be the same for all examples, but the parameters will vary.

The DLL download includes both the Arduino *.ino files for each project and JPEGs of the breadboard diagrams.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Arduino Uno R3
PostPosted: March 23rd, 2017, 5:17 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
In answer to an email yesterday, we're using the following Arduino kit:

https://www.amazon.co.uk/Elegoo-Upgrade ... oo+arduino

It's not necessary to get this kit - you just need the Uno R3 board, drivers and software (which it should come with) and then just buy the components you want.

<mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Arduino Uno R3
PostPosted: March 24th, 2017, 1:58 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
The code for sending and receiving data to an attached Uno R3 board is as follows:

Code:
myDLL = LoadDLL( SYSTEM_PUBLICATION_DIR + "Interaktiv.dll" );

var mySend = "null";
var myReceive = "null";
var myPort ="COM3";

var myData = myDLL.CallFn( "uno_r_three", false, "string","string",mySend,"string",myReceive,"string",myPort);


The first line simply loads the DLL and makes it available to Opus by assigning it to the myDLL variable.

The next three lines are the values SENT to the DLL.

- mySend - this is the data that is passed to the code running on the Uno R3 board. If no data is sent use "null" in inverted commas.
- myReceive - this should be either "null" or "true". This tells the DLL whether it should expect a reply from the Uno R3 board code and to return it to Opus if "true".
- myPort - this is the USB port on which the Uno R3 Board is connected.

The final line is the DLL Call which sends the values above and if myReceive is "true" will store the returned value in the myData variable.

Please note that if you use the DLL to receive data but don't send any back, your program / Opus will probably hang and will need a forced shut-down. I'll look at a solution to this in the future.

There are several examples included:

The two LED examples are the simplest and demonstrate how to send information to the Uno R3 code and register a hardware change (IE LED lights or changes colour).

The LM35 example shows how to read information from a component that is constantly providing data. It works by ONLY taking a reading and sending it when the code on the Uno R3 receives a value, via the DLL, from Opus. In this instance, the myReceive variable is set to "true", which causes the DLL to read the information sent by the Uno R3 code and return it back to Opus.

The Push Button example demonstrates how to read information from a component that is in a temporary state. This works by understanding that Uno R3 board is basic a mini computer that is constantly running your code. When the button is pressed (and subsequently released) the code on the Uno R3 registers this and we change the value of a variable (much like we do in Opus) in the board's code.

While the board is running the code, that variable remains set until we tell it to change. This allows us to query the code at any point to check the value of the variable (and in this case reset it). We can query it every second if we need to respond quickly to the button press or we can query it daily.

The DLL and Uno function is provided as is for anybody interested in using Opus with hardware interfacing.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : lmc


Top
 Profile Visit website  
 
 Post subject: Re: Arduino Uno R3
PostPosted: March 27th, 2017, 11:51 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
*********UPDATE***********

The LED used in the examples should be blue not red. If you wish to use a red LED you will need to use a resistor.

I'll update the diagrams asap.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group