Please point me to some step by step basics to code the PICAXE using Blockly.

Gramps

Senior Member
Here is a test using Hippy's code.
Moving the stick doesn't seem to make any difference.
Correction, snapping the stick gave some low readings.
Also experimented with moving the output lead to the x and y axes. Numbers change but don't correlate with the hammer strikes.


1546299335801.png
 
Last edited:

lbenson

Senior Member
I see no obvious problem with your wiring or setup. In the post above, I see one spot where the numbers drop from the 900s to 267. Does that correspond to a strike? You are looking for numbers significantly lower than the baseline. I don't know why your baseline is 900-something when mine was 480-640.
 

Gramps

Senior Member
Did you have a resistor in series with the input pin?
Another thought, does that C.1 pin need those two resisters installed as we did for the hammer inputs?
Perhaps we are getting a floating pin readout?
 
Last edited:

Gramps

Senior Member
Finally got the LED matrix repaired. bad ground. i didn't do myself any favors when we used solid bell wire to wire the array.
The code ibenson wrote is operating perfectly.
(Still have not done anything with the latest code that includes the LCD screen.)
Question, where do we write the "wait for the hammer" command?
we changed the note speed from 8 to 15 but in the terminal window it still says 8.
 
Last edited:

lbenson

Senior Member
operating perfectly
Glad to hear it. And glad you got your matrix repaired--quite a number of wires to keep straight.

Question, where do we write the "wait for the hammer" command?
At the beginning of the program, make sure bLEDFlag is set to 1 so you go to preprocess and turn the LED on; make sure bPlayTune is set to 0 so the TUNE command is not executed. Then put your "wait for the hammer" code in postprocess. Any further PAUSE you want may be put here before the "wait for the hammer" code.

we changed the note speed from 8 to 15 but in the terminal window it still says 8.
Please post the code as an attachment so I can look at it.
 

premelec

Senior Member
"used solid bell wire " - I haven't heard the term "bell wire" in many decades... recalls to mind that waxed cotton wound color striped stuff... CAT -1 ? ;-0
 

Gramps

Senior Member
Other than a plastic coating about the same thing
Guess that tells you what era I'm from. I'm also a big fan of Hollow State Technology
 

hippy

Technical Support
Staff member
Here is a test using Hippy's code.
Within that stream there are some pretty high (1023) and low (252) numbers, so it may be a case of needing to filter or process the data to detect strikes.

That 1023 is the maximum limit of the READADC10 is interesting and suggests something perhaps isn't quite right. I am not sure however what hardware you are using nor what would be expected. 12 pages in and near 450 posts makes it rather difficult to go back to find out.

It might be worth starting a separate thread on detecting strikes and nothing else.
 

Gramps

Senior Member
I was wondering when it is appropriate to start a new thread and I will do that.

Thanks so much for all your help!
P. S. That's why I printed the thread!!!😀 A ton of very practical information for a picaxe beginner!!!
 
Last edited:
Re: Blocky with APA102 LED chains.
I finally managed to set up Blocky so that the APA102 LEDs can be controlled.
Basically; I had to set up individual tasks that each had a 'Blocky Advanced' Picaxe Basic box with the basic calls inside it. This way; when the task is called, the one line 'hspisetup spimode00, spifast' inside can be executed before others with hspiout 4 byte packets can be sent. But then there is another problem over Blocky variables being 16 bit words while Picaxe Basic also uses 8 bit byte variables . So another Blocky Advanced BASIC paste box is needed, so as to transcribe the contents of Blocky word variables into Picaxe basic Byte variables. The Blocky advanced Basic just needs Basic lines of b10=varA, b11=varB and b12=varC. Then within the Blocky program varA,varB and varC can be used to set up parameters to be transcribed into b10, b11, and b12 Basic Byte variables before calling the task that needs them. This way a task can be called to execute the line hspiout( #FF, b10, b11, b12).
 
Top