DAC Simulation

comet

New Member
Hi, Sorry!

How can I simulate a DAC Output in PE? It's not an very important problem but I can't find an example for it.

Thank you!

comet:)
 

nick12ab

Senior Member
It seems that you can't - when simulated the output is just high.

However, you can add sertxd to print stuff in the simulated terminal so you can see what value the DAC is at. Example:
Code:
#picaxe 14m2
#define simulate
dacsetup %10100000
do
    daclevel 0
    #ifdef simulate then
        sertxd ("Set DAC to ",#0)
    #endif
    pause 2000
    daclevel 3
    #ifdef simulate then
        sertxd ("Set DAC to ",#3)
    #endif
    pause 2000
    daclevel 25
    #ifdef simulate then
        sertxd ("Set DAC to ",#25)
    #endif
    pause 2000
loop
Remove '#define simulate' when you download the program on to an actual PICAXE.
 

IronJungle

Senior Member
Will this work with MacAXEPad?

It seems that you can't - when simulated the output is just high.

However, you can add sertxd to print stuff in the simulated terminal so you can see what value the DAC is at. Example:
Code:
#picaxe 14m2
#define simulate
dacsetup %10100000
do
    daclevel 0
    #ifdef simulate then
        sertxd ("Set DAC to ",#0)
    #endif
    pause 2000
    daclevel 3
    #ifdef simulate then
        sertxd ("Set DAC to ",#3)
    #endif
    pause 2000
    daclevel 25
    #ifdef simulate then
        sertxd ("Set DAC to ",#25)
    #endif
    pause 2000
loop
Remove '#define simulate' when you download the program on to an actual PICAXE.
 

hippy

Ex-Staff (retired)
Does MacAXEPad have a simulator now?
No, only Programming Editor and Logicator provide simulation modes. I perhaps misunderstood IronJungle's question; the code will work, adding / removing '#define simulation' will include or remove the corresponding 'sertxd' commands, but there is no simulation ability with AXEpad.
 
Top