Welcome, Guest
Username: Password: Remember me

TOPIC: Arduino and Proview

Re:Arduino and Proview 12 years 11 months ago #2179

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Ivo,


Oeps...., I am sorry, the arduino sketch standard in Proview 4.8.1-2 is not the same as in the git. It seems to be Claes implemented 'MSG_TYPE_WRITEALL' and 'MSG_TYPE_READALL' in a later *.pde version.

/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.

Re:Arduino and Proview 12 years 11 months ago #2181

  • ivo1204
  • ivo1204's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 44
  • Karma: 2
Hi Marc,

It seems puting
........
if (num)
{
status = ARD__MSGSIZE; <============== HERE!
msgSize = Serial_peek(); // read size of message.
...................
in main.c work
The administrator has disabled public write access.

Re:Arduino and Proview 12 years 11 months ago #2182

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Ivo,

Can you upload your latest version and tell me which I/O's are working.
I am complete lost. Thanks....

/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.

Re:Arduino and Proview 12 years 11 months ago #2183

  • ivo1204
  • ivo1204's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 44
  • Karma: 2
Hi Marc,

Ao and A1 are block, Do and Ai work at 1ms 115 200 / You can put 57600,38400 ../

Config (size=10, id= 1): 50 2 0 16 2 0 32 1 3 0
Debug (id 12, size 10, type 7): 50 2 0 16 2 0 32 1 3 0

Attachment pwr-bb1942d3fbe35a2dd6eaac8fa818de1f.gz not found



For Di : pwr_func.c void readAll(){
----
// Read Digital inputs
for ( i = 0; i < diSize; i++) amsg[ diSize+i] = Di & diMask;
=>
for ( i = 0; i < diSize; i++) amsg[3 +i] = Di & diMask;


Also working Ao2, Ao3 cannels, but for now there should be a Ao0 and Ao1,
also in pwr_func.c
in:
aoWrite () and writeAll ()

Ao = msgData & aoMask ; = => Ao = msgData ;

aoMask makes the output 0
On the Arduino pin 11 and 3 I measure from 0-5V analogue

Ao outputs channels also must have a different number, eg 0,1,2,3

Post edited by: ivo1204, at: 2011/05/15 13:24
Last Edit: 12 years 2 months ago by ivo1204.
The administrator has disabled public write access.

Re:Arduino and Proview 12 years 11 months ago #2191

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Ivo,

I just walked in....
Thanks for all your work and the steps you described.
Tomorrow I will have a look and give your \"Proview-Arduino-Turbo-Version\" a try again.
Don't forget to write your name/license in the header(s).
It's your credit...... and you deserve it.

/M
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.

Re:Arduino and Proview 12 years 11 months ago #2192

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
step 1)
cup of coffee.....

step2)
pwr-bb1942d3fbe35a2dd6eaac8fa818de1f.gz as is (no changes):

pwr.hex --> avrdude -pm328p -carduino -P/dev/ttyACM0 -Uflash:w:pwr.hex:a

Proview --> Ai0 --> LDR + 10k --> 115200 baud

Ai0:
Number 0
Rawvalue range 0 – 1023
ChannelSig ValRange 0 - 5
SensorSigValRange 0 -5
ActValRange 0 – 100

Number: (ADC0) => 23 pin, Arduino 0
Runtime....
RX/TX active...... nice....
LDR responding...., I am not going to check the values....

Great! Ivo!
Lets make a new Ai

Ai1
Same settings as value settings as Ai0 (but pin 1)
Same as Ai0, light dependent resistor.....

Works perfect.
Step 3:

Lets include a digital output.....
I am not going to choose a combinated PWM so let's take Arduino pin 2.

Don't get it working yet.
Only RX active.
Back to step 2

When I completely block out in pwr_func.c the function readAll() the Analog inputs (Aio and Ai1) are still working....(?)

Post edited by: marc, at: 2011/05/17 21:18
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.
Time to create page: 8.758 seconds