(please view with monospace font so columns align, google groups 'Normal 
Normal' seems to work )

Alexander, thank you ( less to worry about)

I would re-phrase the last message...
I cannot get any inputs to work >>using hal_gpio<<
All work fine with RPi.GPIO python module.
( and i mean ALL as i just finished testing each bit )

Also, I think, another an error
gpio22 is coded to align with rpin15
and
gpio21 is coded to align with rpin40
BUT enabling gpio22 gets you hal_gpio.pin-40-in
and enabling gpio21 gets you hal_gpio.pin-15-in
the pairs are crossed

i made 26 configurations,  testing each pin individually.

here's the test.hal and the recorded rpin created for every bit in the 26 
possible

substitute the decimal 'exclude' parameter for the rpin desired

--------------------------------- snip 
-----------------------------------------------
# x.hal scratch file to test each gpio bit , just walk the bits  1 2 4 8 
16...
# damn not walkthe bits, its walk the NOT bit so always a huge frkn number
#11111111111111111111111110 = 67108862 gpio2  gets rpin3  as input
#11111111111111111111111101 = 67108861 gpio3  gets rpin5  as input
#11111111111111111111111011 = 67108859 gpio4  gets rpin7  as input
#11111111111111111111110111 = 67108855 gpio5  gets rpin29 as input
#11111111111111111111101111 = 67108847 gpio6  gets rpin31 as input
#11111111111111111111011111 = 67108831 gpio7  gets rpin26 as input
#11111111111111111110111111 = 67108799 gpio8  gets rpin24 as input
#11111111111111111101111111 = 67108735 gpio9  gets rpin21 as input
#11111111111111111011111111 = 67108607 gpio10 gets rpin19 as input
#11111111111111110111111111 = 67108351 gpio11 gets rpin23 as input
#11111111111111101111111111 = 67107839 gpio12 gets rpin32 as input
#11111111111111011111111111 = 67106815 gpio13 gets rpin33 as input
#11111111111110111111111111 = 67104767 gpio14 gets rpin8  as input
#11111111111101111111111111 = 67100671 gpio15 gets rpin10 as input
#11111111111011111111111111 = 67092479 gpio16 gets rpin36 as input
#11111111110111111111111111 = 67076095 gpio17 gets rpin11 as input
#11111111101111111111111111 = 67043327 gpio18 gets rpin12 as input
#11111111011111111111111111 = 66977791 gpio19 gets rpin35 as input
#11111110111111111111111111 = 66846719 gpio20 gets rpin38 as input
#11111101111111111111111111 = 66584575 gpio21 gets rpin15 as input
#11111011111111111111111111 = 66060287 gpio22 gets rpin40 as input
#11110111111111111111111111 = 65011711 gpio23 gets rpin16 as input
#11101111111111111111111111 = 62914559 gpio24 gets rpin18 as input
#11011111111111111111111111 = 58720255 gpio25 gets rpin22 as input
#10111111111111111111111111 = 50331647 gpio26 gets rpin37 as input
#01111111111111111111111111 = 33554431 gpio27 gets rpin13 as input

# results, this is truth, its what actually happens, wether code is right 
or wrong, this is the result
# 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  
3  2  1  0  GPIO#

#
# original code from hal_gpio.c retrieved from github 13aug2018
#// Raspberry2/3:   edited so the 2 data were adjacent vertically
#static unsigned char rpi2_gpios[] =                                        
*   * these 2 pairs are suspect
#{2, 3, 4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 
22, 21, 23, 24, 25, 26, 27 };
#{3, 5, 7, 29, 31, 26, 24, 21, 19, 23, 32, 33,  8, 10, 36, 11, 12, 35, 38, 
15, 40, 16, 18, 22, 37, 13 };
#static unsigned char rpi2_pins[] =
#
# the original code uses 2 aligned arrays of the gpios and the rpins
# how is it possible to get a different result from them? they are like a 
python dictionary
#
# also where is the code for setting the pin to input, this fails also.
#
# hal show will report the pin as an input but it does not react to 3.3 or 
0V changes ( NONE of 26 tested will change )
# despite hal show hal_gpio.* reporting they are all inputs, thier states 
are fixed forever

# edit the exclude value according to the rpin to be created, there will 
onlybe one pin and it will be an input
loadrt hal_gpio exclude=67108799 dir=0

newthread fast 100000
newthread slow 1000000 fp

addf hal_gpio.write fast

start
---------- now use show pin hal_gpio.*  and a halmeter as you like

I'd like to use the pi's gpio
regards
TomP

On Monday, August 13, 2018 at 4:23:04 PM UTC+7, Alexander Rössler wrote:
>
> Ignore the epsilon, this is for Hal Remote.
>
>  

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to