Oh, this is getting ridiculous. I write a small state machine to test understanding of a micro-controller and it is now going to be used to run a quiz. Additional hardware is on order. (A cheaper Arduino which can be damaged or stolen without affecting my work.) Even sillier, I'm getting feature requests. The first feature request is for lights per participant and per team. So, code has been extended to allow up to four separate buttons for each of four teams:-
begin 644 buzzer.ino.gz
M'XL(`%2YC%D"`Y552U/;,!"^^U=LIQ<#;O%*?F72'`I-@9D`!9+AP.3@8@4T
M8^S4#QA@\M\KVY(39(?2TZZ_77WZ]C'6_BX<E"\O+(.?:087)7^!H_"!Y;"[
M;^SO@GFX0VST87K/X#!-\C0K>/GPM8I6X2IF!W8`&?N2%V%6R&,-CC;DX2-3
MR?F2W?+%,RQYDL-"W,:395GD$"81I&51^37QYX@M>,+@XG)\-9X":8&#\60"
M=/TYFT[/SQ`<#2'@:@@%3T,<\#7$A4!#/!AHB`]H:U``B"TTNQI?3L8_$)#H
M&`&D.D8!'1US`%T=<P$]'?,`?1T3\@(=$_K654S'WT]K?<36,0*D4\<`2*<.
M,5/2*00%8Z<2%)2=4I`"Z=2"#I!.,>@"Z52#'A!]*`.@^E"$2(HZAD")CA&@
MG7VB0/6-$@*IOE-"']6W2LBCOMY9P1?HF.`;&$:9Y/PN81'<WH<9%"Q\N$%O
M/GI58[+^[9`/./0#CO..LQIJ2LN<98U2-19+;;ERJ'(<Y;C*\93C*R=0SL!J
MMZSU6FYLR;%EQY8>6W[T.H)_ET71")9SLN2?0EHJK2.M*ZTGK2]M(.W`4GNF
M',6(BA(5)RI25*P]`L6_LV`WZ,^'AO&8\@@BGMR9/"GJK;`JIVKZ#KP:(&)W
MO`CCZXP7S*SCQR='QSM#/52=V!*J_J0;(1:'SR;:MKTE<W)^74<R5I19,C16
M2F4J5#:BWM835]GB%V_&(WL8?T-O&._M-8D]^F_B>7M%3PUOPTVKXOE(YEVR
M,#+K`<?S.F5EJ*1JXIM9S8/26\F?IY`7VQLNRJSQ&JO./]WSF)D]Y*-1>W=;
MKVQOJZYIFR9#/)!9F4":W++Z%:QEY2*^W-YA\9*>II$<TOEL^FO65*?P1I-U
M<J8"VT:B#JAI;'"M@VH6O4$Y@8V[5N^N@.QH=43RJO&WS5GU-BAC2R8:',7/
DZS;%:;K\_SWD"[-OASZ-U(JI1)#KT2]XU97Z%U!H?@E5"0``
`
end
(Usual instructions for uudecode process.)
Another feature request is distinct sound samples per participant or per team. That would be awkward. The sound samples would either have to be compressed and compiled into flash with the program or loaded into RAM via a USB virtual serial port or invoke an unholy set of libraries to read FAT32 flash storage over SPI and play MP3s or invoke a separate piece of hardare which does the same task or port/re-implement algorithm to a different platform, such as a Raspberry Pi. So, no, there won't be distinct sound samples. Pin goes high. Pin drives NPN transistor. Buzzer makes noise.
If people also want scores on a digital display then the project may be re-implemented on other hardware. At that point, someone else can continue the project because I have more important tasks.
I wrote a small program to implement the buzzer round of a quiz game. This is not much more than a "Hello World!" test in the quest to implement a 3D surround sound speaker array which itself is part of a larger project. During this process, I repeatedly bump into emperical but mundane reality. The most mundane problem includes not having any momentary switches to hand and only having latching switches. Therefore, the buzzer game code has been updated so that it works either type of switch. This has the side-effect that any of the switches may be independently wired with pull-up resistors or pull-down resistors. Therefore, the project has gained some idiot-proofing which may be considered elsewhere.
begin 644 buzzer.ino.gz
M'XL(`+8WBED"`WV27V_:,!3%W_,I[K27@+(1_V%E0KRT8FTE5M8NJ,]18UI+
MJ9W93BNH^.Z+8P@D=7B+S\_']^;<.QK"9;G=,@6_I(+[DF_A.GUE&H:C8#2$
M\&J`8W0!R0N#*RFT5(:7K]\MM=BR>!)/0+%OVJ3*[&U.1S'H](T=+NN"/?'U
M!@HN-*RK:EP4I=&0B@QD:>QW_?#7C*VY8+"XO;Y)$."V@(&T!0*T+5`8-\+E
M?+&`'\?C*DF6=P@N.@J&24<A\+.C4$!Q(]T_S/_.$T`H"+@PH%&D<:1)I&FD
MQ],@>),\@XR+Y]#B?``?`53G9V[2_%%QP\(\NJF:'4R[NNWX!+$\W80HCN.>
MFXOE8TT4,Z42TV!WJ"VKVIZR+M3&]IGA,XR<8;1A&LWV^(&E6;C/W"'L0=@A
MXD'$(>I!U*%Q"[FQ>`/Y]YYRTYY&E5!>WWU_X3D+/0_-9GKL;A]'43MV]H$Z
MXDZM:L]5*4"*)U8O<UU;5[S83Z/:_M\R:P:Q7"5_5J[C%L&]A/02ZB/UEOAT
M-Y;H]LY/<"\AO81ZB$OR!-2YN[]WYR;&(\&]A/02VB&?AZ)8P5+#LGQS'$TN
MY6$R?!WZ]O;+3*/##K@E.FE^U^?#UH<]/GS>1ZR/>'SDO(]:'_7X:.,[">0_
(J"G,$O8%````
`
end
I've written a program which implements the functionality for a buzzer round of a quiz game. This is suitable for two, three or four teams to have a common button (or buttons wired in parallel). The program performs a power-up test of lights and buzzer before entering the main loop. When a member of one team presses the team's button, a buzzer sounds for one second and the team's light stays locked on until the quizmaster hits a reset button.
It requires an Arduino compatible micro-controller configurable as five digital inputs (button1, button2, button3, button4, reset) and five digital outputs (light1, light2, light3, light4, bell). The first team has a very small advantage which can be measured in millionths of a second. Making a completely equally weighted input is left as an exercise. Keeping score is a more difficult exercise because it requires a routine to compensate for switch bounce.
begin 644 buzzer.ino.gz
M'XL(`#P`AUD"`WV26T^#,!B&[_D57^(-6]1!6]V,V<W,/"33>6#9-9%N:X(M
MEJ+9S/Z[I3`$I+N#]^G[G0=]F&2['95P*R2\9&P'=^$'3:$_<`9]<&]ZR/.'
M$&PHW`B>"JE8]G&>TQSGS!MY(Y#T+%6A5`>0)O2=K;:0,)["2D=F/,E4"B&/
M0&0J_S9!3B*Z8IS"[.'N/O`!-04$N"E@($V!P$4E3*:S&5S^_2Z"8/[DP["E
M(!BU%`Q7+86`[U72R^OT;1J`[SO.EV`11(RO7<85Q#WX<4#_KYD*XZ5DBKKQ
MZ;VNJW?=UO/B:HC&X=;U/<^SO)S-EX9(JC+)KYW](;?0N3O2%O.K;/\9.L+P
M$49*=BC@\SMDJMF]KB@V[N\-BZE;QGBE8>06H^N-QWD0^-GG[TT')J"^$YEQ
M$/R=FF,P"5+=<5*VJ*_G4415=_-%\+P(3*H&05:"K81T$3/Z+KTXI=.'IVZ"
MK`1;">D@Q;AJP`RWZ+[X+X=7)\A*L)60%JF=6;D421,:*AK%V[_5Q$(<-L-6
LC3V7`]*+-B=NGD!Y*[7R]S8GLCO1<2>V._%Q)[$[2>6L#>87E=OD@RH%````
`
end
(This is the 37th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)
I'm working on a 3D surround sound speaker array as part of a larger project. I'm working through a list of tasks. One particular sticking point has been to deploy code on a micro-controller. This has been a limitation since at least Apr 2015 and has been complicated by trying to use a clone of the least supported Arduino on a poorly supported host without using the supplied idiot interface. Regardless, I report success if using a large number of third-party binaries count as success.
The first complication is that Arduino is open source and the schematics are freely available. Therefore, anyone who is time rich and cash poor may purchase a clone of the official Arduino boards. I purchased a board which was approximately 1/2 of the official price and I'm told that it was possible to purchase similar for 1/3 of the official price. So far, I've not encountered any incompatibility but I'm told that clones may omit ground-planes to reduce cost and therefore I/O may fail to work at full rated speeds. This is quite pausible. I understand that the processor on the first Raspberry Pi was only intended for use with eight layer boards and that the choice to use a six layer board limited storage card communication to a maximum of 15Mb/s and even this is optimistic.
The second complication is compiling ARM Cortex M3 code for no operating system when the host is ARMv6. This involves installing a random set of binaries on Raspbian using apt-get and then using /usr/bin/arm-none-eabi-gcc which may or may not have been present when I started.
The third complication is deployment of code to a Atmel ARM SAM via BOSSA. Each manufacturer has its own method of programming a micro-controller and this particularly true for ARM. So, one protocol is used for Atmel AVR chips, a different protocol is used for Atmel ARM chips and different protocols are used for ARM chips from other manufacturers. To further complicate matters, there are two (or more?) implementations of BOSSA programmer. The official one from Atmel works on Windows and Linux. An open source re-implementation uses wxWidgets and works on more platforms. From the dependancies installed via apt-get, it would appear that Raspbian uses the implementation which uses wxWidgets.
The fourth complication is that installation of arduino, arduino-core, bossa and bossa-core fails to provide any ARM firmware under /usr/share/arduino/hardware/arduino or suchlike. Indeed, the Arduino IDE 1.8.0, 1.8.1, 1.8.2 and 1.8.3 has no support for ARM. This would be particularly problematic if downloading the software recommended via Arduino's online shop. Ignore the official recommendations. Use 1.6.8 or 1.6.13 rather than the latest and greatest version.
The fifth complication is to avoid the IDE. This can be achieved by hacking up some random Makefile to use $(HOME)/Arduino-1.6.13/hardware/arduino/sam, /usr/bin/arm-none-eabi-gcc and /dev/ttyACM0. You may also want to use suitable flags to reduce compilation time, compilation size and execution time. Unfortunately, this will not increase security because there is no support for stack protection when using Arduino's BLOBs.
After working through these problems, compilation and deployment of a blink light worked first time. After a quick play with LED PWM, I devised a library so that it is possible to divine more than one bit of state when an error occurs on a micro-controller. Indeed, this will blink up to four hexadecimal digits and also blink an arbitrary error string in Morse code:-
begin 644 error.c.gz
M'XL(`"K3AED"`Y68;6_:,!#'W_,I/"J50"$8VK6LK)TZ^L36EJZCZQXU&6+`
M(R29$TK9Q'>?0R`%#+E=D%"P[WX^W_WMF!1SY$1:0^&XY$Q*5Y*::W%R)5J2
MR3')%5/%'#%JV3(M'9!FCZMNQW=E((8#,^P-N]O,M@D/G0WZ5"KO[N73Z2SI
M*!9W+)O[/K%=UR-NAPR8['-)F&,12W1%X)NS$181^?2U\F%=;L*4:U?Z/`XD
M#))6:(7X`9/!O'7H<V+Q#AO:03Q5X5BBS0(%]X1#ALZ4[P8]+D="F?L>;XN.
MX-84O24ZC@*0^LUIO7;2;-S]O*W?I+94DW#X<BLI[::V5+RBDTH]NL**YO2S
M90NG;P@G("P??K>RY&^*1#E@]H,4`3>6./G+^L5EMAK:<)N-#1;=;[:_:CPL
MF+>F]Y('0^E44Y.E6+K,,V;#3VWW*4VPMMQ@9KTXDS*E^7*R'_-[:QSW04=/
M>--$69&S+[H.MTB[QR2Q:>BF%&'8](A6;?K:L+;ITWE6W>[L1/9D,>[0?!)'
M,)WXYH$'H92,<*`<\<>#"!=&XL7#>N&PJN^;1W]4O84Q_9$(VCUCUC5O)4K6
M2DP9,W,8MVCQ15=+<M:?_YPL>1?6>4^S"[C/-*][QXG8Z#Q!)"ZJ5CY*G):V
M44_8W"@='97F65$+[EIM,2OZ;=PW;^^;LZ@6%5,*M5:924:1.U'-J6J))_:L
M'.OXN%2>F4Y6'#;85]:;;[#>6VN]P9@N&<<*TO43*VA%/W,-D"4-D"7%IDEZ
MH9@KY7Q6PQSU(@E5,-6G@.)]SR0!%:U0,%'`[62>:>)P!C!?9'19$(=+'TWD
MA1<*5P*+@<*5$W$F%K>;C,-*;P_`(4OQ$L+AE+*?K!0L[B!9*%A<!=`=$O<*
MDC$.9P)[`':5Y:'D(957!&J+G.X;:)DAJW&2.5QI8<D)1='?:O06)'44OZ;Q
MV]`S"\4_U?@6$#\*?Z;A>6+R4?!S#=X!M(/C7VC\+K!T4/A+#=^#-ET4OZ[Q
M13(?17^GT7]!CUL4_[W&[P/"1^&O-+P-';50_&N-/TC6#HI^H]&=Y.2@Z`V-
M[@)/-!3^5L-[@')PX7_0^+^!98N+_T[C2T`Z*/Q'#>\#VP(*W]3P06)V4/![
M#3X$=F04_I.&?X0.T2C^@\8?`<I$X3]K^"?HZ(3B?]'X8^@/&HK_5>/_@8Z2
;_\E?\W9FP_N9C9#E=S4++V?^`7A,_//4%0``
`
end
Motor control using audio amplifiers tenuously overlaps with speaker arrays. It uses some of the same amplifier chips and some of the same code to process WAV files. In particular:-
begin 644 audio-for-motor.c.gz
M'XL(`*-T@UD"`[57;4_;2!#^SJ]84D%MXR1KQZ1<P4B4HRU26ZI`#U5<%)ED
MDUC:[%KV&D(/_OO-OMBQ0Q*H3H>0UYZ9W7EF=M[2=M`/$=-8/*`KCCX11M)(
M$'22CV*.KJ,[\I&GLPS!$WWE`IZGG(F44^2TM]H.LDYM'WOOT-642$[&4Q'G
MLY;D2K;DX7<=#V4B2H79HX@'N+,@;KV)V9#F(X*.,I'&;-*:'M=H`.89B<:W
M2[2'K"T>$I(])X,F4:>.ATS0.BEG,1PK:4`<LQ$9HV\?/OS<>@-O,2/J`QUL
MO2%L%(^W2O+)U^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JK?1^
M$CU`R1F][/Y1)**7W=\M3:NFG:HOM3RK5M3Z(1;%S<!V5-KOK$ST?CO8LZBO
MI/:7I!89VF]+3[RLS7N5MLYKM:WJLJKX+E=O[8I5C3[/H@EYCW8R=-,4:)2G
M:JX%AP\R,N1LE/5KS7ZI[:NF[^OV(JOR"&;UB`V)5>T2?JU/4>Q0O$=]AU;V
MS:*8J3U1.AGJZ<V1[W>+!I+HP4;.."P*;OQ]7/8"\*U\-=U'_JJ`!ZZ0=,N#
M4EAV#QCN/!<:%^V8^4@J#L-RUC.>:DP)3;91_':&TIPQ^`V$QBF?P;B/3F;Q
M)$(Q^&@;/%0=@KSR;D!C2];>T(SK"0X]%=33&()#JFPF^#CT*P,U(![.$LF[
MNTEPWVTT1<.N`*L<&@D>%X)[7K\8MA&A&:E(RW!04KA?F\=A4^@72$%S@K=#
M":ETP;.=98/#,M/PT1_P6*29XGB2XTF.M^`8GB]YON3Y59[A=B2W([F=.E>!
ML^3V,+!W=Z4DO-B/CT##QYKDF15D:$>^E8$H4]=5&774M>WZN1`?YIYUOMB[
M3!:?G;A9_+=@J&BXE6@Q'BS^(/)"GL`O"+GQ8G#:.SNY>KP87/<NOGWYZ5X.
MSGL_+GN/L%Z;M?>I]UU]F[5W<?59?<.Z=#98#<<?X67,F\9UJ-C0;24B,ZJC
MMSO96S6OFXMT*Z8N*2QG^.ZRF4_+P&2.*9MW(='LYQ@WHAQQ&"PD3E"7B?\$
MU-L(M$AB,R+*[%5:6DK/^O.+$;A`HMK-(@;<73G9UK<,*<_4SZL:?0&G>'LJ
1$_"I*)_F)_F_*DC%@/,1````
`
end
(Usual instructions for uudecode process.)
To obtain pre-computed 60 second audio samples, type:-
shell> gunzip audio-for-motor.c.gz
shell> cc audio-for-motor.c -o audio-for-motor
shell> audio-for-motor -t 60
This will generate 113 audio files - a useful subset of 9^4 (6561) possible permutations. The format for the audio files is four digits where:-
and:-
So, 8-8-4-4.wav means full speed forward. 8-0-4-4.wav means left forward, right backward. (Turn clockwise on spot?) 8-8-3-3.wav means full speed with slight negative trim.
This works with a PAM8403 amplifier board and a compact cassette tape pinch motor powered at 3.3 Volts. It is quite fun to click on the icon of an audio file and then see a motor change speed and/or direction. However, the speeds are not monotonic and I suspect the effect may be influenced by vibration in the motor induced by the low frequency signal. Also, the efficiency is worse than expected - even after several modifications to the wave generation algorithm. As a fallback case, diodes may be used. This may improve efficiency. It also doubles the number of motors which can be controlled (at the expense of bi-directional motion).
(This is the 36th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)
I've been off-line doing various tasks. During this period, I've researched Arduino library code. One particularly dumbed-down snippet has appalled several members of my local makerspace. From /usr/share/arduino/libraries/Robot_Control/examples/learn/LineFollowWithPause/LineFollowWithPause.ino:-
Robot.setMode(MODE_LINE_FOLLOW);
Yep. The Arduino library has functionality to abstract away the feedback algorithm required to make a line-following robot. It also has:-
Robot.pauseMode(true);
presumably so a robot can dance, stab someone over the Internet and then continue following a line.
Something I find quite bizarre about the Arduino libraries is the mix of software licences. Are they even compatible? The bootloader is LGPL. Most of the libraries are GPL or MIT licence. Documentation is Creative Commons. I have no idea why documentation would be under a different licence to all of the code.
Most of my time has been spent writing software to process or generate audio signals. I started with a utility to upscale monophonic or stereophonic audio to Ambisonic WXYZ format. It occurs to me that I have to extend the functionality of the sound processor for the speaker array to handle A-Format and B-Format. This optionally requires a 4×4 matrix multiplication prior to the main signal processing. However, the contents of the matrix depends upon the orientation of the original recording. A-Format is typically four directional microphones in a tetrahedral arrangement. Most obviously, one would be "up" while three others would have 120° spacing and a downward incline. This can be converted into the directionally neutral B-Format which is more suitable for mixing and soundstage rotation. Or A-Format could be played directly. However, any use of A-Format assumes one orientation or that some meta-data is present which specifies a known orientation and/or arbitrary inclines.
Anyhow, converting monophonic or stereophonic audio incurs a pivot and one bit loss of audio quality described in Meridian Audio's documentation for Meridian Lossless Packing. Specifically, W=(L+R)/2 and X=(L-R)/2. It was this expected pivot operation which led me to consider A-Format to B-Format processing. Presumably, W=(P+Q+R+S)/4 and the remainder depend upon microphone orientation.
After writing a program to read a one or two channel WAV and write a four channel WAV, it was trivial to re-purpose this into a program which only writes a two channel WAV. This outputs variants of sine waves for line-following robots, quadcopters and suchlike. Code to follow.
I require one common routine which:-
Implementation contains further documentation:-
begin 644 transpose.c.gz
M'XL(`/-D<ED"`^V::V_;-A2&O_M7$"@PV$[2B(SF&DM3H.F&!5BR`6DS8!CZ
M@99IBR@EJB(5-UCZWW>HBW67+"]I"BQN69GBX<MS>'DL'/5XBLZY1E=4A_P+
M^A!27P52,?1'P$*JN?05FAZ/CJ=H_&Y"+/P*?7`9>@>W9:AYY+TTK::9^YKY
M2[9$*QFB!=='"^JON;]&BFF%Y`HQOG8UU$).!5(Z9-13+U-M*I1$D6*K2,3]
M`T%]&B)'>D'(E`(OD&:.Z_//$5/;(8T[UBMR`FHTU*E4>M-&BMZRV/(%7X%C
M*_3[^?E?HQ?PC?LLKJ#YZ`7XS%=)`!IQA9A_R\UX$(AVJ49Z.R$;+@22CA.%
M$"L*0NF`9^`K#1V7@W<Z`E?!2KLH9&NN-`NW\<E`<X\K$.5>()C'?)W.+4P,
M%6L90C</I)@1ON4PCUE7]L41T=),I&9>($,:WJ%;"I.X$$P=HOET;F8;><GZ
MY>[";*J?CK+Q$<+3F1U;9LZ]S-O(](24VE2AT9[B66MC-GRM3;LPF?`W@)7A
M3B1H*.Y,\+!KJ*_1QF4A*[KW]OH*=E;D+;()4*#=X=7;/Z]S2SQK];$R/]7I
M7TDAY`91L]4\N5W6HF=5!84^1Q`4^+\TFU["!,'$"NE\*OJG-\4&L\R@H>(5
M5AL:!/D"@S&CCINIF@%4M#A:\G@;)$.0*:D/$?<**`^-NK$P/9NUM_T;U?$4
M]Z@;BXIZ<N:#2&_G"EV]/T=MGTO3EM@='!T==9;4[AZ]@C*#\B,4&\H)%`(%
M0[&@/.L]ZSV27LPP`U/X.?)B6&SWN;$I?FKUK3_E3[W^$'97$G[F&NPNI%@6
M[7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R9VA-S"[]Y4[IUNH\[N-$=W.X.KKM#ZNZ0/=TA
MC>Z0=G=(W1U<=P?O[$[_ALDW1.HB#-2T+UXPH5@!_R>D&?]=X!S.]N&,'0[0
MX70<CK[A7!L.K2)LBARRRQSJIH\]A#ZDESXY<^QAS(G].$N^MF[F>67\[/"9
MH4ITRD_@0=(QM[@X+3H?GX-Q1>0B.X!)T)-)N4NNF/6LCG&9'>JR0'?PWP_A
M[.^+<'8WX4@CX>QD?4K/M)-QC7B=R,.S?N3U(ZX):4,1U@^@?N#T`Z9(#>7*
M,$<**2,E:6R'"AD"%;L7*O%P*5;(,*R0'"ND=0?9^V+%?G"LV#6LV/MCA3P(
M4W$O4W%_\+@<O#V8J;@<O+U;\-\/Q$@WQ.Q&B)'](=;&K79>M7.JG4\-7.KE
M42W3T,X1G&]@O#/_S5);[:?7VFXNTG1ZK7P#6SN>WHIBUK,ZQM#3B_=%E]5^
M>JT&K.#^X#M.KU5#5^,80T\OWA==);])2_`Y5DA_\*0<_+PQ^'DM^,(8Y>#G
<U?,:_Z_M\@6AD.DH]$]'7T>C?P&?0(9LUBX`````
`
end
Bit matrix transpose algorithm is its own inverse. So, test performs two transpose operations. Test input uses a marching bit test which is a more thorough version of a walking bit test:-
begin 644 transpose-test.c.gz
M'XL(`/QD<ED"`XV1P6[;,`R&[WX*SD$`Q342V6[1`G%V2"^[M+ODL&'+`-66
M$P*2;$C*L*'HNU>T/3?9>I@.$L6/XO^#6B6P10\/PEO\!3LKC.M:)^%S)ZWP
MV!K82>?AD[!&.@?)*EHEP.X7.<]N87>4<-\:UUJ/)[TD2AAUIZ26QCO0PE9'
M-`=X"B*>.C6M[2]Z4/238OM'<>I#&OPV+\!Y87V?G:&IU*F64#I?8[L\?KQ(
MV2!UD8NG_LLJIN>-J64#C]OMUV@6(C2RO\!=-).FQB:*T)`Y-(P"80]56AV%
MA20)\<\%/$<`)^/P8&0-/='7WZC%/M4W0[#^IT3Q5&6IRE-5K*-`M=1.>J:O
M4Y[2D\7Z+'GSE@S9,"^F\@U?J[S,PW9U-7@8248D*ZD^G&]PQ)PP'S$_QT"^
M5;;_L6%962K>6QB!U%7WFXP$@Y.]84WSO-/N*92<H5ZP(,%B%"PN!0&Z\$&^
M8?&<YU]BFI<J]F<=7J*_"[^;^/_$L6%D6W<TU."\M_UAP]_7;P0J$![8'-,Y
?+H)*_S_\'2_#2?L+?8>5_F0-H\IP?P5])VKL/@,`````
`
end
After more extensive testing, code requires something akin to:-
#ifdef __avr
#define REG16 1
#endif
#ifdef __arm
#define REG32 1
#endif
There Was a Ceooked Man, He Flipped a Crooked House
David Erik Nelson
July-August Fantasy & Science Fiction
I finally caught up on my reading, and the latest F&SF magazine has the best novella I've read in a long time. It will be on sale until September 4.
When I first started reading it, the thought occurred to me that the author was trying to cash in on last year's bogus controversy about black writers not being published (how would an editor know?), and perhaps he was, but it's a great story none the less. It starts out in Detroit with a black locksmith with four years of architectural training under his belt, and a large white man who is slightly retarded. They work for a real estate agent, who has just bought the house. Their jobs are to check it out.
Before they get close, they're hassled by the cops, with the locksmith in handcuffs until he shows his certification as a locksmith and his license for "burglar tools". The cops leave, the locksmith picks the lock, and his training tells him the door is installed backwards.
He steps inside and falls out the back door. I thought then that it was a remake of an old Heinlein story, especially after several such attempts, but it wasn't anything like that at all. They call the boss, who comes out and sees the oddities himself, and curses. He gives the locksmith a silver key.
Later, having met a foreign toourist who complained that there's nothing interesting to photograph, offers to show her the house. He uses the key--and the door opens from the other side. They go in, and it really starts getting wierd. Books by authors who didn't write them, like a memoir of William Shatner written in Esperanto, and the fact that outside the windows isn't Detroit. And a sneaker with a foot still in it.
Not to give too much awy, it involves superior creatures from... another dimention? I was two thirds of the way through it before I could see it was science fiction.
I plan on nominating it for a Hugo next year. It's well worth the cost of the magazine.
(This is the 35th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)
I'm working on a 3D surround sound speaker array as part of a larger project. I am also expecting a delivery of 13 Watt quadraphonic audio amplifiers for a tenuously related project. I have immediate tasks to complete:-
This is very likely to take more than three weeks. I may be off-line for the majority of this period.
(This is the 34th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)
In the book: Waldo by Robert Anson Heinlein, a 1950s style workshop (lathe, hammer, saw) is used to make a 1/4 scale matching pair of three finger mechanical hands. This requires the tedious work of drawing wire, winding motors, constructing capacitors and suchlike. A 1/4 scale set of tools is also constructed. Using the hands and the appropriate size tools, 1/16 scale hands can then be constructed. Likewise for 1/16 scale tools. Then, 1/64 scale hands and tools can be constructed. (Incidentally, this process requires very little material. For example, 1/64 scale hammer handle requires very little wood.)
A stable work environment for an Arduino is an analogous problem. While it is possible to install Arduino development software on any system, this is a haphazard approach which can fail at inopportune times. There are also the problems of security and reproducibility. My solution to this problem is pragmatic but far from ideal. Ultimately, chips used in all Arduino designs are proprietary. Deployment of code onto these chips uses avrdude for AVR architecture or bossac for ARM architecture. These handle architectual quirks, such as EEPROM partitioning, EEPROM privileges as seen from the running code and recovery from failed programming cycles. I also assume conversion of ELF blobs to raw binary occurs at this stage but I have seen no mention of this process. Regardless, all of this occurs over a virtual serial port over USB which itself is poorly defined. The implementation may involve an FTDI serial adapter or functional equialent and therefore safe and continued use is mutually exclusive with Microsoft Windows drivers.
For development of a speaker array, the solution to this mess is as follows:-
The advantages of this arrangement are numerous:-