{"id":8732,"date":"2007-04-19T09:08:00","date_gmt":"2007-04-19T13:08:00","guid":{"rendered":"https:\/\/nuxx.net\/blog\/2007\/04\/19\/basic-help-please\/"},"modified":"2026-07-01T11:35:21","modified_gmt":"2026-07-01T15:35:21","slug":"basic-help-please","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2007\/04\/19\/basic-help-please\/","title":{"rendered":"Basic Help, Please."},"content":{"rendered":"<p>I&#8217;m having some problems with a subroutine in the small program I&#8217;ve been working on mikroBasic for the Honda Music Link stuffs I&#8217;ve been doing.<\/p>\n<p>Could any of you help me?<\/p>\n<p>To start, here&#8217;s a copy of the program in a text file: <a href=\"http:\/\/nuxx.net\/files\/hml_mikrobasic_help.txt\">hml_mikrobasic_help.txt<\/a><\/p>\n<p>Here&#8217;s the project itself, zipped up: <a href=\"http:\/\/nuxx.net\/files\/hml_mikrobasic_help.zip\">hml_mikrobasic_help.zip<\/a><\/p>\n<p>The IDE \/ compiler itself, <a href=\"http:\/\/www.mikroe.com\/en\/compilers\/mikrobasic\/pic\/\">mikroBasic, is available here<\/a>. <\/p>\n<p>(I&#8217;m just using the demo version, and the limit is only on code size, so feel free to install it. I don&#8217;t come anywhere near the code limit, and when one does it&#8217;s rather obvious, as the compiler just refuses to compile it.<\/p>\n<p>The problem I&#8217;m having is with <tt>sendCommand()<\/tt>, and specifically the variable <tt>iPodCommand<\/tt>, which is the first one passed to it. What I expect to happen is that whatever is passed as the first argument to <tt>sendCommand()<\/tt> will be set and available within the procedure. Instead, I seem to be getting something else.<\/p>\n<p>As the program is currently listed, I would expect the output <tt>sendCommand(powerOn, 0)<\/tt> to be <tt>0xFF 0x55 0x04 0x00 0x00 0x00 0x04 0xF8<\/tt>. However, the output I receive is <tt>0xFF 0x55 0x02 0xFE 0xB9 0x47<\/tt>.<\/p>\n<p>The expected packet is broken down as follows:<\/p>\n<blockquote><p><tt>0xFF<\/tt> &#8211; Header 1<br \/>\n<tt>0x55<\/tt> &#8211; Header 2<br \/>\n<tt>0x04<\/tt> &#8211; Data Length<br \/>\n<tt>0x00<\/tt> &#8211; Data 1<br \/>\n<tt>0x00<\/tt> &#8211; Data 2<br \/>\n<tt>0x00<\/tt> &#8211; Data 3<br \/>\n<tt>0x04<\/tt> &#8211; Data 4<br \/>\n<tt>0x08<\/tt> &#8211; Checksum (0x100 &#8211; Data Length &#8211; All Data Packets)<\/p><\/blockquote>\n<p>The received packet breaks down this way:<\/p>\n<blockquote><p><tt>0xFF<\/tt> &#8211; Expected Header 1<br \/>\n<tt>0x55<\/tt> &#8211; Expected Header 2<br \/>\n<tt>0x02<\/tt> &#8211; Length appropriate if the constant referenced by <tt>iPodCommand<\/tt> were two bites in length.<br \/>\n<tt>0xFE<\/tt> &#8211; Data 1 (Not sure where this comes from.)<br \/>\n<tt>0xB9<\/tt> &#8211; Data 2 (This one neither&#8230;)<br \/>\n<tt>0x47<\/tt> &#8211; Checksum, calculated properly off of unexpected Data bytes.<\/p><\/blockquote>\n<p>When I run things through the hardware debugger I&#8217;m not seeing the variable <tt>iPodCommand<\/tt> as an array, and I&#8217;m not sure why or how (it just shows a value of <tt>0xDF<\/tt>). That, though, and it&#8217;s not working as expected, is leading me to believe that I&#8217;m doing something wrong in setting up <tt>sendCommand()<\/tt>.<\/p>\n<p>So, could any of you please help me? I just don&#8217;t know what I&#8217;m doing wrong.<\/p>\n<p>Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m having some problems with a subroutine in the small program I&#8217;ve been working on mikroBasic for the Honda Music Link stuffs I&#8217;ve been doing. Could any of you help me? To start, here&#8217;s a copy of the program in a text file: hml_mikrobasic_help.txt Here&#8217;s the project itself, zipped up: hml_mikrobasic_help.zip The IDE \/ compiler\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,6,34],"tags":[],"class_list":["post-8732","post","type-post","status-publish","format-standard","hentry","category-computers","category-electronics","category-moved-from-livejournal"],"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=8732"}],"version-history":[{"count":1,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8732\/revisions"}],"predecessor-version":[{"id":12898,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8732\/revisions\/12898"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=8732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=8732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=8732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}