Read ultrasonic block not working for 28X2 in Blockly for Picaxe

stevesmythe

Senior Member
I'm pretty sure that the "read ultrasonic" block in Blockly for Picaxe doesn't work on a 28X2 processor. The code below works fine on an 08M2 but doesn't work on my AXE401 with a 28X2 fitted (the value of VarA is shown in debug as 33792 regardless of the position of the SRF005).

read_ultra.jpg

The same SRF005, with the same connections, does work properly on the AXE401/28X2 when programmed directly with Picaxe BASIC.
 

hippy

Ex-Staff (retired)
Blockly converts the blocks to PICAXE basic, then compiles that, so it is not clear why it should work differently when programmed from Blockly or Basic. The code generated seems to be correct so we would need to investigate further.

Can you tell us which version number of PE6 you are using and the Blockly version number ( top right of the Blockly editing form ). And could you post the Basic code which works.
 

stevesmythe

Senior Member
I'm using the Blockly app for Windows v1.1.5. The code that works in PE is:
Code:
#Picaxe 28X2
  Do    
    Ultra C.1, w0
    Pause 20
    debug
  Loop
 

JimPerry

Senior Member
I'm using the Blockly app for Windows v1.1.5. The code that works in PE is:


PE6 is not involved


Yes it is ...:confused:










PE6 is not involved


I'm using the Blockly app for Windows v1.1.5. The code that works in PE is:
 

hippy

Ex-Staff (retired)
I'm using the Blockly app for Windows v1.1.5. The code that works in PE is:
Code:
#Picaxe 28X2
  Do    
    Ultra C.1, w0
    Pause 20
    debug
  Loop
Perhaps add a PAUSE in the Blockly code to see if that improves things, or conversely take it out of the Basic and see if it is still reliable.
 

stevesmythe

Senior Member
There are two different versions of Blockly for Picaxe

1. Blockly (within PE6) -
"C:\Program Files\Revolution Education\PICAXE Editor\PicaxeEditor.exe" /blockly


This gives you all of the functionality of PE6, and Blockly

2. Blockly (standalone Windows app) -
"C:\Program Files\Revolution Education\Blockly\BlocklyForPICAXE.exe"


This just gives you Blockly. Doesn't involve PE6 as such.

I have done some further testing and I think the (recently updated) Debug window in the Blockly app is the problem. The ULTRA command is working but the values do not update in the Debug window.

____ postscript _____

I forgot to say that the code explorer window in Blockly/PE6 does show the value of varA correctly. If I load the same XML file to Blockly/PE6 it works but then in Blockly (app) it doesn't update varA in the debug window.
 
Last edited:

hippy

Ex-Staff (retired)
I have done some further testing and I think the (recently updated) Debug window in the Blockly app is the problem. The ULTRA command is working but the values do not update in the Debug window.
Thanks for taking the time to investigate and please accept our apologies if there is an issue with the Debug display updating. We will investigate that.
 
Top